#include <bits/stdc++.h>
using namespace std;
long long mod = 1e18;
int n, a[100][100], b;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  if (n == 1) {
    int x;
    cin >> x;
    if (x == 1)
      return cout << "Yes" << '\n', 0;
    else
      return cout << "No" << '\n', 0;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> a[i][j];
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (a[i][j] == 1) continue;
      for (int k = 0; k < n; k++) {
        if (k == i) continue;
        for (int k1 = 0; k1 < n; k1++) {
          if (k1 == j) continue;
          if (a[i][j] == a[k][j] + a[i][k1]) {
            b = 1;
            break;
          }
        }
        if (b) break;
      }
      if (!b) {
        cout << "No" << '\n';
        return 0;
      }
      b = 0;
    }
  }
  cout << "Yes" << '\n';
  return 0;
}
