#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  srand(time(NULL));
  int n;
  cin >> n;
  vector<vector<int> > v(n, vector<int>(n));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> v[i][j];
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (v[i][j] != 1) {
        bool t = false;
        for (int k = 0; k < n; k++) {
          if (k != i) {
            for (int l = 0; l < n; l++) {
              if (l != j) {
                if (v[i][j] == v[k][j] + v[i][l]) {
                  t = true;
                  break;
                }
              }
            }
            if (t) break;
          }
        }
        if (!t) {
          cout << "No";
          return 0;
        }
      }
    }
  }
  cout << "Yes";
  return 0;
}
