Bobo draws n intervals on the axis, which are conveniently numbered by 1,2,…,n. As an excellent mathematician, he managed to set all n intervals of length 106.
Then bobo carefully computes I_i,j, the length of the intersection of intervals i and j, 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 n intervals of length 106 providing the same result.
The first line contains an integer n (1≤n≤1000).
Each of the following n lines contains n integers I_i,1,I_i,2,…,I_i,n (0≤I_i,j≤106).
Since bobo knows math well, it is guaranteed that I_i,j=I_j,i and I_i,i=106.
If for given I_i,j it is possible to find at least one appropriate set of intervals, print "Yes". Otherwise, print "No".