#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<vector<int>> grid(n, vector<int>(n));
  for (int r = 0; r < n; r++)
    for (int c = 0; c < n; c++) cin >> grid[r][c];
  bool is_good = true;
  for (int x = 0; x < n; x++)
    for (int y = 0; y < n; y++)
      if (grid[x][y] != 1) {
        bool decomposable = false;
        for (int s = 0; s < n; s++)
          for (int t = 0; t < n; t++)
            decomposable |= grid[x][y] == grid[x][s] + grid[t][y];
        if (!decomposable) is_good = false;
      }
  cout << (is_good ? "Yes" : "No") << endl;
}
