#include <bits/stdc++.h>
using namespace std;
int a[60][60];
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]);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++)
      if (a[i][j] != 1) {
        int flag = 0;
        for (int i1 = 1; i1 <= n; i1++)
          for (int j1 = 1; j1 <= n; j1++)
            if (a[i][j1] + a[i1][j] == a[i][j]) flag = 1;
        if (flag == 0) {
          printf("No\n");
          return 0;
        }
      }
  printf("Yes\n");
  return 0;
}
