#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, p, q;
  scanf("%d", &n);
  int A[51][51] = {0};
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      scanf("%d", &A[i][j]);
    }
  }
  int flag, ans = 1;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      if (A[i][j] == 1) continue;
      flag = 0;
      for (p = 1; p <= n; p++) {
        if (p == i) continue;
        for (q = 1; q <= n; q++) {
          if (q == j) continue;
          if ((A[p][j] + A[i][q]) == A[i][j]) {
            flag = 1;
            break;
          }
        }
      }
      if (flag == 0) {
        ans = 0;
        break;
      }
    }
    if (flag == 0) {
      ans = 0;
      break;
    }
  }
  if (ans == 0)
    printf("No");
  else
    printf("Yes");
  return 0;
}
