var a: array [1..100, 1..100] of integer; i, j, n: integer; f:boolean; begin readln(n); for i := 1 to n do for j := 1 to n do read(a[i, j]); f:=true; i:=1; while (i<=n-1)and(f)do begin j:=i+1; while (j<=n)and(f)do if a[i,j]=a[j,i] then inc(j) else f:=false; inc(i); end; if f then writeln('yes') else writeln('no'); end.