#include <bits/stdc++.h>
using namespace std;
int num[51][51];
int n;
bool judge() {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (num[i][j] != 1) {
        int flag = 0;
        for (int k = 0; k < n; k++) {
          if (k != j)
            for (int l = 0; l < n; l++) {
              if (l != i) {
                if (num[i][k] + num[l][j] == num[i][j]) {
                  flag = 1;
                  goto here;
                }
              }
            }
        }
      here:
        if (flag == 0) return false;
      }
    }
  }
  return true;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      scanf("%d", &num[i][j]);
    }
  }
  printf("%s\n", judge() ? "Yes" : "No");
}
