#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, mat[60][60];
  cin >> n;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) cin >> mat[i][j];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (mat[i][j] == 1) continue;
      bool ok = false;
      for (int x = 0; x < n; x++) {
        for (int y = 0; y < n; y++) {
          if (mat[i][x] + mat[y][j] == mat[i][j]) {
            ok = true;
            break;
          }
        }
        if (ok) break;
      }
      if (!ok) {
        cout << "No";
        return 0;
      }
    }
  }
  cout << "Yes";
  return 0;
}
