#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
char s[1000500];
int a[55][55], n;
int main() {
  n = read();
  int gg = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) a[i][j] = read();
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) {
      if (a[i][j] != 1) {
        int flag = 0;
        for (int k = 1; k <= n; k++)
          for (int p = 1; p <= n; p++)
            if (a[i][k] + a[p][j] == a[i][j]) {
              flag = 1;
              break;
            }
        if (!flag) {
          gg = 1;
          break;
        }
      }
    }
  if (gg)
    puts("No");
  else
    puts("Yes");
  return 0;
}
