#include <bits/stdc++.h>
using namespace std;
long long A[100][100];
int main() {
  long long(n);
  scanf("%lld", &n);
  for (long long i = 0; i < (n); ++i)
    for (long long j = 0; j < (n); ++j) scanf("%lld", &(A[i][j]));
  for (long long i = 0; i < (n); ++i)
    for (long long j = 0; j < (n); ++j) {
      if (A[i][j] != 1) {
        set<long long> SS;
        bool ok = 0;
        for (long long jj = 0; jj < (n); ++jj) SS.insert(A[i][jj]);
        for (long long ii = 0; ii < (n); ++ii)
          if (SS.count(A[i][j] - A[ii][j])) ok = 1;
        if (!ok) return 0 * puts("No");
      }
    }
  puts("Yes");
}
