#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t, n, m, x, i, j, k, l, ans;
  cin >> n;
  long long a[n][n];
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < n; j++) cin >> a[i][j];
  bool ok;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      if (a[i][j] != 1) {
        ok = 1;
        for (long long k = 0; k < n; k++) {
          for (long long l = 0; l < n; l++) {
            if (a[i][k] + a[l][j] == a[i][j]) {
              ok = 0;
              break;
            }
          }
          if (!ok) break;
        }
        if (ok) {
          cout << "No" << '\n';
          return 0;
        }
      }
    }
  }
  cout << "Yes" << '\n';
  return 0;
}
