#include <bits/stdc++.h>
using namespace std;
const int N = 55;
int n;
int grid[N][N];
bool ok(int x, int y) {
  if (grid[x][y] == 1) return true;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      if (i == x || j == y) continue;
      if (grid[i][y] + grid[x][j] == grid[x][y]) return true;
    }
  return false;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) scanf("%d", grid[i] + j);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (!ok(i, j)) {
        printf("No\n");
        return 0;
      }
  printf("Yes\n");
  return 0;
}
