#include <bits/stdc++.h>
template <typename Arg1>
void ZZ(const char* name, Arg1&& arg1) {
  std::cout << name << " = " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void ZZ(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  std::cout.write(names, comma - names) << " = " << arg1;
  ZZ(comma, args...);
}
using namespace std;
long long n, m, q;
vector<vector<long long> > ar;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  ar.resize(n);
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      long long t;
      cin >> t;
      ar[i].push_back(t);
    }
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      if (ar[i][j] != 1) {
        bool flag = false;
        for (long long k = 0; k < n; k++) {
          if (k != i) {
            for (long long l = 0; l < n; l++) {
              if (l != j) {
                if (ar[k][j] + ar[i][l] == ar[i][j]) {
                  flag = true;
                  break;
                }
              }
            }
          }
          if (flag == true) {
            break;
          }
        }
        if (!flag) {
          cout << "No" << endl;
          return 0;
        }
      }
    }
  }
  cout << "Yes" << endl;
  return 0;
}
