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