#K52177. Symmetric Matrix Check

    ID: 29252 Type: Default 1000ms 256MiB

Symmetric Matrix Check

Symmetric Matrix Check

Given an n x n matrix, determine whether it is symmetric. A matrix A is symmetric if and only if it satisfies the property \(A_{ij} = A_{ji}\) for all valid indices \(i, j\). You are required to read the matrix from standard input, check the symmetry, and output "YES" if the matrix is symmetric and "NO" otherwise.

Note: The matrix is always a square matrix.

inputFormat

The first line of input contains a single integer n which represents the size of the matrix. The following n lines each contain n space-separated integers representing the matrix rows.

For example:

3
1 2 3
2 4 5
3 5 6

outputFormat

Output a single line with the string "YES" if the matrix is symmetric, or "NO" if it is not.

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