#include <bits/stdc++.h>
struct Problem {
  virtual void main() = 0;
};
using namespace std;
struct A : Problem {
  int n;
  vector<vector<int>> v;
  void main() override {
    while (cin >> n) {
      cout << solve() << endl;
    }
  }
  bool check(int r, int c, int s) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (s == v[r][i] + v[j][c]) {
          return true;
        }
      }
    }
    return false;
  }
  string solve() {
    v.resize(n, vector<int>(n));
    for (auto& row : v)
      for (auto& e : row) cin >> e;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (v[i][j] > 1 && !check(i, j, v[i][j])) {
          return "No";
        }
      }
    }
    return "Yes";
  }
};
struct B : Problem {
  void main() override {}
};
struct C : Problem {
  void main() override {}
};
int main() {
  unique_ptr<Problem> ptr(new A());
  ptr->main();
  return 0;
}
