#include <bits/stdc++.h>
using namespace std;
const int MAX = 105;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<vector<int>> m(n, vector<int>(n));
  for (auto &x : m)
    for (auto &y : x) cin >> y;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) {
      bool ok = false;
      if (m[i][j] == 1) continue;
      for (int k = 0; k < n; ++k)
        for (int l = 0; l < n; ++l) ok |= m[i][k] + m[l][j] == m[i][j];
      if (!ok) {
        cout << "No";
        return 0;
      }
    }
  cout << "Yes";
}
