#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<vector<int>> v;
  for (int i = 0; i < n; ++i) {
    vector<int> temp;
    for (int j = 0; j < n; ++j) {
      int x;
      cin >> x;
      temp.push_back(x);
    }
    v.push_back(temp);
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (v[i][j] == 1) continue;
      int flag = 0;
      for (int p = 0; p < n; ++p) {
        for (int q = 0; q < n; ++q) {
          if (v[i][p] + v[q][j] == v[i][j]) flag = 1;
        }
      }
      if (!flag) {
        cout << "No";
        return 0;
      }
    }
  }
  cout << "Yes";
}
