#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n][n];
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      cin >> a[i][j];
    }
  }
  bool flag = true;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (a[i][j] == 1) continue;
      bool temp = false;
      int x = 0;
      while (temp == false && x < n) {
        int y = 0;
        while (temp == false && y < n) {
          if (a[x][j] + a[i][y] == a[i][j])
            temp = true;
          else
            ++y;
        }
        ++x;
      }
      if (temp == false) flag = false;
    }
  }
  if (flag)
    cout << "Yes";
  else
    cout << "No";
  return 0;
}
