#include <bits/stdc++.h>
using namespace std;
vector<set<int> > st(60);
int a[55][55];
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      cin >> a[i][j];
      st[j].insert(a[i][j]);
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (a[i][j] == 1) continue;
      bool f = 0;
      for (int x = 0; x < n; ++x) {
        if (a[i][x] < a[i][j] && st[j].count(a[i][j] - a[i][x])) f = 1;
      }
      if (!f) {
        cout << "No";
        return 0;
      }
    }
  }
  cout << "Yes";
  return 0;
}
