#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(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];
    }
  }
  int flag = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (v[i][j] != 1) {
        flag = 0;
        for (int k = 0; k < n; k++) {
          for (int l = 0; l < n; l++) {
            if (k != i && j != l && v[k][j] + v[i][l] == v[i][j]) flag = 1;
          }
        }
        if (flag == 0) {
          cout << "No";
          return 0;
        }
      }
    }
  }
  cout << "Yes";
}
