#K41472. Symmetric Matrix Checker

    ID: 26873 Type: Default 1000ms 256MiB

Symmetric Matrix Checker

Symmetric Matrix Checker

Given a square matrix, determine if it is symmetric. A matrix \(A\) is symmetric if \(A_{ij} = A_{ji}\) for all indices \(i, j\). In other words, the matrix should be equal to its transpose.

You are provided with an integer \(n\) representing the dimensions of the matrix, followed by \(n\) lines each containing \(n\) space-separated integers. Print "YES" if the matrix is symmetric and "NO" otherwise.

inputFormat

The input begins with an integer \(n\) denoting the number of rows (and columns) of the matrix. The next \(n\) lines each contain \(n\) space-separated integers representing the rows of the matrix.

outputFormat

Output a single line with the word "YES" if the matrix is symmetric, otherwise output "NO".

## sample
3
1 2 3
2 4 5
3 5 6
YES