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