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