#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 1;
long long a[51][51], u[N];
long long n, m, k, l, r, x, y, z, cnt, ans, sum, mx = -1e18, mn = 1e18, T;
string s, t;
vector<pair<string, string> > v;
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) continue;
      x = 0;
      for (int k = 1; k <= n; k++) {
        for (int l = 1; l <= n; l++) {
          if (a[k][j] + a[i][l] == a[i][j] && k != i && l != j) {
            x = 1;
            break;
          }
        }
        if (x) break;
      }
      if (!x) {
        cout << "No";
        return 0;
      }
    }
  }
  cout << "Yes";
}
