#include <bits/stdc++.h>
using namespace std;
const int N = 55;
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, m, a[N][N];
  vector<long long> v1, v2;
  cin >> n;
  m = n;
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j <= m; j++) cin >> a[i][j];
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= m; j++) {
      if (a[i][j] == 1) continue;
      v1.clear();
      v2.clear();
      long long r = i, c = j;
      for (long long k = 1; k <= m; k++) {
        if (k == c) continue;
        v1.push_back(a[r][k]);
      }
      for (long long k = 1; k <= n; k++) {
        if (k == r) continue;
        v2.push_back(a[k][c]);
      }
      long long sum = 0;
      bool f = 0;
      for (long long x = 0; x < v1.size(); x++) {
        for (long long y = 0; y < v2.size(); y++) {
          sum = v1[x] + v2[y];
          if (sum == a[i][j]) {
            f = 1;
            break;
          }
        }
        if (f) break;
      }
      if (f == 0) {
        cout << "No";
        return 0;
      }
    }
  }
  cout << "Yes";
}
