#include <bits/stdc++.h>
using namespace std;
bool cmp(pair<pair<long long int, long long int>, long long int> a,
         pair<pair<long long int, long long int>, long long int> b) {
  return a.second > b.second;
}
bool check(vector<vector<long long int> > s, int x, int y) {
  int n = s.size();
  for (long long int j = 0; j < n; j++) {
    for (long long int k = 0; k < n; k++) {
      if (s[x][j] + s[k][y] == s[x][y]) {
        return true;
      }
    }
  }
  return false;
}
bool func(vector<vector<long long int> > s,
          vector<pair<pair<long long int, long long int>, long long int> > v) {
  long long int n = s.size();
  for (long long int i = 0; i < v.size(); i++) {
    if (v[i].second != 1) {
      long long int x = v[i].first.first;
      long long int y = v[i].first.second;
      if (!check(s, x, y)) {
        return false;
      }
    }
  }
  return true;
}
int main() {
  long long int n;
  cin >> n;
  vector<vector<long long int> > s;
  vector<pair<pair<long long int, long long int>, long long int> > v;
  for (long long int i = 0; i < n; i++) {
    vector<long long int> v1;
    for (long long int j = 0; j < n; j++) {
      long long int p;
      cin >> p;
      v1.push_back(p);
      v.push_back({{i, j}, p});
    }
    s.push_back(v1);
  }
  sort(v.begin(), v.end(), cmp);
  if (func(s, v))
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
