#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  long long int n = 0;
  cin >> n;
  long long int a[n][n];
  long long int count = 0;
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < n; j++) {
      cin >> a[i][j];
      if (a[i][j] != 1) count++;
    }
  }
  bool ans = true;
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < n; j++) {
      if (a[i][j] != 1) {
        for (long long int k = 0; k < n; k++) {
          for (long long int l = 0; l < n; l++) {
            if (a[k][j] + a[i][l] == a[i][j]) {
              ans = true;
              break;
            } else
              ans = false;
          }
          if (ans) break;
        }
      }
      if (!ans) break;
    }
    if (!ans) break;
  }
  if (ans)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
