#include <bits/stdc++.h>
using namespace std;
long long t[50][50];
int n;
bool verif(int i, int j) {
  for (int a = 0; a < n; ++a)
    for (int b = 0; b < n; ++b)
      if (t[i][a] + t[b][j] == t[i][j] && a != j && b != i) return 1;
  return 0;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) cin >> t[i][j];
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j)
      if (t[i][j] != 1 && !verif(i, j)) {
        cout << "No";
        return 0;
      }
  cout << "Yes";
  return 0;
}
