#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int a[51][51];
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) cin >> a[i][j];
  bool good = true;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (a[i][j] != 1) {
        bool thisok = false;
        for (int k = 0; k < n; ++k) {
          for (int p = 0; p < n; ++p) {
            thisok |= a[i][k] + a[p][j] == a[i][j];
          }
        }
        good &= thisok;
      }
    }
  }
  cout << (good ? "Yes" : "No") << endl;
}
