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