#include <bits/stdc++.h>
using namespace std;
long long mat[200][200];
int n, flag;
void solve() {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (mat[i][j] != 1) {
        flag = 0;
        for (int s = 0; s < n; s++) {
          if (s == j) {
            continue;
          }
          for (int t = 0; t < n; t++) {
            if (t == i) {
              continue;
            }
            if (mat[i][j] == mat[i][s] + mat[t][j]) {
              flag = 1;
              t = n;
              s = n;
            }
          }
        }
        if (flag == 0) {
          return;
        }
      } else {
        flag = 1;
      }
    }
  }
  return;
}
int main() {
  cin >> n;
  flag = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> mat[i][j];
    }
  }
  solve();
  if (flag == 0) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
  }
  return 0;
}
