#include <bits/stdc++.h>
using namespace std;
int a[51][51];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) cin >> a[i][j];
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++)
      if (a[i][j] != 1) {
        bool f = false;
        for (int i1 = 1; i1 <= n; i1++)
          for (int j1 = 1; j1 <= n; j1++)
            if (i != i1 and j != j1 and a[i][j] == a[i][j1] + a[i1][j])
              f = true;
        if (f == false) {
          cout << "No";
          return 0;
        }
      }
  cout << "Yes";
  return 0;
}
