#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int ans = 0;
  int n;
  cin >> n;
  int ar[100][100];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> ar[i][j];
    }
  }
  bool b = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      for (int h = 0; h < n; h++) {
        for (int k = 0; k < n; k++) {
          if (ar[i][j] != 1)
            if ((ar[i][k] + ar[h][j]) == ar[i][j]) {
              b = 1;
            }
        }
      }
      if (!b && ar[i][j] != 1) {
        cout << "no" << endl;
        return 0;
      }
      b = 0;
    }
  }
  cout << "yes" << endl;
  return 0;
}
