#include <bits/stdc++.h>
using namespace std;
int n, a[55][55];
int check(int r, int c) {
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (i != r && j != c && a[i][c] + a[r][j] == a[r][c]) return 1;
    }
  }
  return 0;
}
int main() {
  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 && !check(i, j)) {
        cout << "No" << endl;
        return 0;
      }
    }
  }
  cout << "Yes" << endl;
  return 0;
}
