#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, s, t;
  int cell = 0;
  cin >> n;
  int a[n][n];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> a[i][j];
    }
  }
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) {
      cell = 0;
      for (s = 0; s < n; s++)
        for (t = 0; t < n; t++)
          if (a[i][j] == a[i][s] + a[t][j]) cell = 1;
      if (a[i][j] != 1 && cell == 0) return cout << "No", 0;
    }
  cout << "Yes", 0;
}
