#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n][n];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) cin >> a[i][j];
  }
  int f = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (a[i][j] != 1) {
        int c = 0;
        for (int p = 0; p < n; p++) {
          for (int q = 0; q < n; q++) {
            if (a[i][j] == a[p][j] + a[i][q]) {
              c = 1;
              continue;
            }
          }
        }
        if (!c) {
          f = 1;
          break;
        }
      }
    }
  }
  if (!f)
    cout << "Yes";
  else
    cout << "No";
  return 0;
}
