#include <bits/stdc++.h>
using namespace std;
const int N = 55;
int n, a[N][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 x = 1; x <= n; x++)
          for (int y = 1; y <= n; y++)
            if (a[i][j] == a[i][x] + a[y][j]) flag = 1;
        if (!flag) {
          puts("No");
          return 0;
        }
      }
  puts("Yes");
}
