#include <bits/stdc++.h>
using namespace std;
int i, mid, ans1, n, ans, l, r, a[100][100];
bool f;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) cin >> a[i][j];
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (a[i][j] != 1) {
        f = false;
        for (int l = 1; l <= n; l++) {
          for (int r = 1; r <= n; r++) {
            if (r == i || l == j) continue;
            if (a[r][j] + a[i][l] == a[i][j]) f = true;
          }
        }
        if (f == false) return cout << "No", 0;
      }
    }
  }
  cout << "Yes";
}
