#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int t[n][n];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) cin >> t[i][j];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (t[i][j] != 1) {
        bool yes = false;
        for (int s = 0; s < n && !yes; s++) {
          for (int p = 0; p < n && !yes; p++) {
            if (t[i][j] == t[i][s] + t[p][j]) yes = true;
          }
        }
        if (!yes) {
          cout << "No" << endl;
          return 0;
        }
      }
    }
  }
  cout << "Yes" << endl;
  return 0;
}
