#include <bits/stdc++.h>
using namespace std;
const long long ool = 1e18 + 9;
const int oo = 1e9 + 9, base = 1e9 + 7;
const double eps = 1e-7;
const int N = 111;
int n, a[N][N];
int main() {
  ios_base ::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  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) continue;
      bool ok = 0;
      for (int k = 1; k <= n; ++k) {
        for (int k2 = 1; k2 <= n; ++k2) {
          if (a[i][j] == a[i][k] + a[k2][j]) ok = 1;
        }
      }
      if (!ok) {
        cout << "No\n";
        return 0;
      }
    }
  }
  cout << "Yes\n";
  return 0;
}
