#include <bits/stdc++.h>
using namespace std;
int a[55][55];
int main() {
  int n;
  cin >> n;
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> a[i][j];
      if (a[i][j] != 1) {
        cnt++;
      }
    }
  }
  bool flag = false;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (a[i][j] != 1) {
        flag = false;
        for (int y = 0; y < n; y++) {
          int num = a[i][j] - a[i][y];
          for (int h = 0; h < n; h++) {
            if (a[h][j] == num) {
              flag = true;
              cnt--;
              break;
            }
          }
          if (flag) break;
        }
      }
    }
  }
  if (cnt == 0)
    cout << "Yes";
  else
    cout << "No";
}
