#include <bits/stdc++.h>
const int MAXINT = 2147483640;
const long long MAXLL = 9223372036854775800LL;
const long long MAXN = 1000000;
const double pi = 3.1415926535897932384626433832795;
using namespace std;
long long x1[300][300];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  srand(time(0));
  long long n, i, j, i1, j1, h, m;
  cin >> n;
  m = n;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++) cin >> x1[i][j];
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++)
      if (x1[i][j] != 1) {
        h = 0;
        for (i1 = 1; i1 <= n; i1++)
          for (j1 = 1; j1 <= m; j1++)
            if (i1 != i and j1 != j)
              if (x1[i1][j] + x1[i][j1] == x1[i][j]) h++;
        if (!h) {
          cout << "No" << endl;
          return 0;
        }
      }
  cout << "Yes" << endl;
  return 0;
}
