IntermediateRating 1100
Constant Diagonals
Print YES if every top-left to bottom-right diagonal has equal elements.
Input
r c, then r lines.
Output
YES or NO.
Sample 1
Input
3 4 1 2 3 4 5 1 2 3 9 5 1 2
Output
YES
Sample 2
Input
2 2 1 2 2 2
Output
NO
Output appears here