#include <bits/stdc++.h>
using namespace std;
int main() {
  const int N = 50;
  int n;
  cin >> n;
  int a[N][N] = {0};
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> a[i][j];
    }
  }
  for (int x = 0; x < n; x++) {
    for (int y = 0; y < n; y++) {
      if (a[x][y] == 1) continue;
      bool f = false;
      for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
          if (a[x][y] == a[x][i] + a[j][y]) {
            f = true;
            break;
          }
        }
        if (f) break;
      }
      if (!f) {
        cout << "No";
        return 0;
      }
    }
  }
  cout << "Yes";
}
