#include <bits/stdc++.h>
using namespace std;
int ara[100][100];
int main() {
  int i, j, k;
  int n, a, b, flag;
  cin >> n;
  for (i = 0; i < n; ++i)
    for (j = 0; j < n; ++j) cin >> ara[i][j];
  for (i = 0; i < n; ++i) {
    for (j = 0; j < n; ++j) {
      flag = 0;
      if (ara[i][j] == 1) continue;
      for (a = 0; a < n; ++a) {
        for (b = 0; b < n; ++b) {
          if (ara[i][a] + ara[b][j] == ara[i][j]) flag = 1;
        }
      }
      if (!flag) {
        cout << "No" << endl;
        return 0;
      }
    }
  }
  cout << "Yes" << endl;
}
