#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, count = 0, c = 0, flag = 0;
  cin >> n;
  vector<vector<int> > a(n, vector<int>(n, 0));
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      cin >> a[i][j];
      if (a[i][j] != 1) c++;
    }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (a[i][j] != 1) {
        for (int k = 0; k < n; k++) {
          for (int l = 0; l < n; l++) {
            if (a[i][j] == a[k][j] + a[i][l]) {
              flag = 1;
              break;
            }
          }
          if (flag == 1) break;
        }
      }
      if (flag == 1) count++;
      flag = 0;
    }
  }
  if (count == c)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
