Intervals

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

Bobo draws nn intervals on the axis, which are conveniently numbered by 1,2,,n1, 2, \dots, n. As an excellent mathematician, he managed to set all nn intervals of length 10610^6.

Then bobo carefully computes I_i,jI\_{i, j}, the length of the intersection of intervals ii and jj, and discards all intervals. However, bobo wants to check his calculations and he is eager to know whether the result can be correct.

In another word, determine if there exists nn intervals of length 10610^6 providing the same result.

입력

The first line contains an integer nn (1n10001 \leq n \leq 1000).

Each of the following nn lines contains nn integers I_i,1,I_i,2,,I_i,nI\_{i, 1}, I\_{i, 2}, \dots, I\_{i, n} (0I_i,j1060 \leq I\_{i, j} \leq 10^6).

Since bobo knows math well, it is guaranteed that I_i,j=I_j,iI\_{i, j} = I\_{j, i} and I_i,i=106I\_{i, i} = 10^6.

출력

If for given I_i,jI\_{i,j} it is possible to find at least one appropriate set of intervals, print "Yes". Otherwise, print "No".