#include <bits/stdc++.h>
using namespace std;
int maxx(int fd, int sd) { return (fd > sd) ? fd : sd; }
int minn(int fd, int sd) { return (fd < sd) ? fd : sd; }
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  if (b == 0) return a;
  if (a < b)
    return gcd(b % a, a);
  else
    return gcd(a % b, b);
}
int main() {
  int n;
  scanf("%d", &n);
  vector<vector<int>> a(n);
  for (int i = 0; i < n; ++i) {
    a[i].resize(n);
    for (int j = 0; j < n; ++j) {
      scanf("%d", &a[i][j]);
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (a[i][j] == 1) continue;
      bool b = false;
      for (int k = 0; k < n; ++k) {
        for (int l = 0; l < n; ++l) {
          if (a[i][k] + a[l][j] == a[i][j]) {
            b = true;
            break;
          }
        }
        if (b) break;
      }
      if (!b) {
        printf("No");
        return 0;
      }
    }
  }
  printf("Yes");
  return 0;
}
