#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  int a[53][53];
  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++) {
      if (a[i][j] != 1) {
        int x = i, y = j, flag = 0;
        for (int p = 0; p < n; p++) {
          for (int q = 0; q < n; q++) {
            if (p != x && q != j && a[p][y] + a[x][q] == a[i][j]) flag = 1;
          }
        }
        if (!flag) {
          cout << "No";
          return 0;
        }
      }
    }
  }
  cout << "Yes";
  return 0;
}
