#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n][n];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> arr[i][j];
    }
  }
  int sum = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (arr[i][j] == 1) {
        continue;
      }
      int flag = 0;
      for (int k = 0; k < n; k++) {
        if (k == i) continue;
        for (int l = 0; l < n; l++) {
          if (l == j) continue;
          sum = arr[i][l] + arr[k][j];
          if (sum == arr[i][j]) {
            flag = 1;
            break;
          }
        }
        if (flag == 1) break;
      }
      if (flag == 0) {
        cout << "No\n";
        return 0;
      }
    }
  }
  cout << "Yes\n";
  return 0;
}
