#include <bits/stdc++.h>
using namespace std;
const int MAXN = 55;
int a[MAXN][MAXN];
int n;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) scanf("%d", &a[i][j]);
  }
  bool flag = 1;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      if (a[i][j] == 1) continue;
      bool now = 0;
      for (int k = 1; k <= n; ++k) {
        if (k == i) continue;
        for (int l = 1; l <= n; ++l) {
          if (l == j) continue;
          if (a[k][j] + a[i][l] == a[i][j]) {
            now = 1;
            goto nex;
          }
        }
      }
    nex:
      if (!now) {
        flag = 0;
        goto out;
      }
    }
  }
out:
  printf("%s", flag ? "Yes" : "No");
  return 0;
}
