#include <bits/stdc++.h>
using namespace std;
int n, a, b, i, j, v[55][55], stop;
int main() {
  cin >> n;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= n; j++) cin >> v[i][j];
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      if (v[i][j] != 1) {
        stop = 0;
        for (a = 1; a <= n; a++) {
          for (b = 1; b <= n; b++) {
            if (v[i][a] + v[b][j] == v[i][j]) stop = 1;
          }
        }
        if (stop == 0) {
          cout << "No";
          return 0;
        }
      }
    }
  }
  cout << "Yes";
}
