#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, count1 = 0, count2 = 0, k, yes = 0, l;
  cin >> n;
  int num[n][n];
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      cin >> num[i][j];
      if (num[i][j] != 1) count1++;
    }
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (num[i][j] > 1) {
        yes = 0;
        for (k = 0; k < n; k++) {
          for (l = 0; l < n; l++) {
            if (num[i][j] == num[i][k] + num[l][j]) {
              yes++;
              break;
            }
          }
          if (yes == 1) break;
        }
        if (yes == 1) count2++;
      }
    }
  }
  if (n == 1) {
    if (num[0][0] > 1)
      cout << "No";
    else
      cout << "Yes";
  } else if (count1 == count2) {
    cout << "Yes";
  } else if (count1 != count2 || count1 == 0) {
    cout << "No";
  }
}
