#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int arr[N][N];
  set<int> col[N];
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      cin >> arr[i][j];
      col[j].insert(arr[i][j]);
    }
  }
  int flag = 0;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      if (arr[i][j] != 1) {
        int flag1 = 1;
        for (int k = 0; k < N; k++) {
          if (col[j].find(arr[i][j] - arr[i][k]) != col[j].end()) {
            flag1 = 0;
            break;
          }
        }
        flag = flag | flag1;
      }
    }
  }
  if (!flag) {
    cout << "Yes";
  } else {
    cout << "No";
  }
  return 0;
}
