#K92152. Symmetric Matrix Checker

    ID: 38134 Type: Default 1000ms 256MiB

Symmetric Matrix Checker

Symmetric Matrix Checker

This problem requires you to determine if a given square matrix is symmetric, i.e. a matrix \(A\) is symmetric if \(A[i][j] = A[j][i]\) for all valid indices \(i\) and \(j\). You will be provided with an integer \(n\) which represents the size of the matrix (both rows and columns) followed by \(n\) rows, each containing \(n\) integers. Print YES if the matrix is symmetric; otherwise, print NO.

inputFormat

The input is read from stdin and structured as follows:

  1. The first line contains an integer \(n\), the size of the matrix.
  2. The next \(n\) lines contain \(n\) space-separated integers each, representing the rows of the matrix.

outputFormat

The output should be written to stdout. Print YES if the matrix is symmetric; otherwise, print NO.

## sample
1
5
YES