#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m = 0, k = 1, e, mo = 0, x, y = 0, d, i, l = -8909, j = -987,
                   na = 0, p = 0, o = 0, t = 0, z = 0, c1 = 12341, c2 = -2;
  cin >> n;
  long long int a[n][n], b[n][n];
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      cin >> a[i][j];
      b[i][j] = a[i][j];
    }
  }
  p = 0;
  z = 0;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (a[i][j] != 1) {
        z = 0;
        for (k = 0; k < n; k++) {
          for (l = 0; l < n; l++) {
            if (k == j || l == i) continue;
            if (a[i][k] + a[l][j] == a[i][j]) {
              z = 1;
              break;
            }
          }
          if (z == 1) break;
        }
        if (z != 1) {
          cout << "No";
          return 0;
        }
      }
    }
  }
  cout << "Yes";
  return 0;
}
