#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100;
int p[MAXN][MAXN];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) scanf("%d", &p[i][j]);
  bool isGood = true;
  bool judge;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j)
      if (p[i][j] != 1) {
        judge = false;
        for (int k = 0; k < n; ++k)
          for (int l = 0; l < n; ++l)
            if (p[i][j] == p[i][k] + p[l][j]) judge = true;
        if (!judge) isGood = false;
      }
  if (isGood)
    printf("Yes\n");
  else
    printf("No\n");
  return 0;
}
