#include <bits/stdc++.h>
using namespace std;
void printArr(int a[], int l, int r) {
  for (int i = l; i <= r; i++) {
    cout << a[i] << " ";
  }
  cout << endl;
}
void printMtx(int a[][1010], int n, int m) {
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cout << a[i][j] << " ";
    }
    cout << endl;
  }
}
int a[60][60], n;
bool check(int r, int c) {
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if ((i != c) && (j != r)) {
        if (a[r][i] + a[j][c] == a[r][c]) return true;
      }
    }
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cin >> a[i][j];
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (a[i][j] != 1) {
        if (!(check(i, j))) {
          cout << "No\n";
          return 0;
        }
      }
    }
  }
  cout << "Yes\n";
}
