#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:108777216")
using namespace std;
int const MAX_N = 256;
int s[MAX_N][MAX_N];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) scanf("%d", &s[i][j]);
  int t = 1;
  for (int i = 0; i < n && t; i++)
    for (int j = 0; j < n && t; j++)
      if (s[i][j] != 1) {
        int Ok = 0;
        for (int a = 0; a < n && !Ok; a++)
          for (int b = 0; b < n && !Ok; b++)
            if (s[a][j] + s[i][b] == s[i][j]) Ok = 1;
        if (!Ok) {
          t = 0;
          break;
        }
      }
  if (t)
    cout << "Yes";
  else
    cout << "No";
  return 0;
}
