#include <bits/stdc++.h>
using namespace std;
int a[55][55];
int n, m;
bool check(int x, int y) {
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      if (a[x][j] + a[i][y] == a[x][y]) return 1;
    }
  return 0;
}
int main() {
  cin >> n;
  m = n;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      cin >> a[i][j];
    }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      if (a[i][j] != 1 && check(i, j) == 0) {
        cout << "No" << endl;
        return 0;
      }
    }
  cout << "Yes" << endl;
  return 0;
}
