~/algor $ cat problems/matritsa-simmetrikmi
Symmetric matrix
Easy
1000 ms
128 MB
33%
A square integer matrix of size $n \times n$ is given. If the matrix is symmetric about its main diagonal ($a_{i,j} = a_{j,i}$ for all $i, j$), print YES, otherwise print NO.
Input
The first line contains two equal positive integers $n$ and $n$. Each of the next $n$ lines contains $n$ integers.
Output
YES or NO.
Note
$1 \le n \le 200$
$-1000 \le a_{i,j} \le 1000$
Examples
Input #1
3 3 1 2 3 2 5 6 3 6 9
Output #1
YES
Input #2
2 2 1 2 3 4
Output #2
NO