#include <bits/stdc++.h>
using namespace std;
const long long N = 300005;
int32_t main() {
  long long tc = 1;
  while (tc--) {
    long long n;
    cin >> n;
    long long a[n][n];
    for (long long i = 0; i < n; i++) {
      for (long long j = 0; j < n; j++) cin >> a[i][j];
    }
    long long flag = 0;
    for (long long i = 0; i < n; i++) {
      for (long long j = 0; j < n; j++) {
        if (a[i][j] == 1)
          continue;
        else {
          long long flag1 = 0;
          for (long long k = 0; k < n; k++) {
            for (long long l = 0; l < n; l++) {
              if (a[k][j] + a[i][l] == a[i][j]) flag1++;
            }
          }
          if (flag1 == 0) flag++;
        }
      }
    }
    if (flag)
      cout << "No";
    else
      cout << "Yes";
  }
}
