#include <bits/stdc++.h>
using namespace std;
int n, a, b, c, i, j, l, o, m[55][55];
int main() {
  cin >> n;
  while (i < n) {
    while (j < n) {
      cin >> m[i][j];
      j++;
    }
    i++;
    j = 0;
  }
  i = 0;
  while (i < n) {
    while (j < n) {
      while (l < n) {
        while (o < n) {
          if (m[i][o] + m[l][j] == m[i][j]) c++;
          o++;
        }
        l++;
        o = 0;
      }
      if (c == 0 && m[i][j] != 1) return cout << "No", 0;
      j++;
      l = 0;
      c = 0;
    }
    i++;
    j = 0;
  }
  cout << "Yes";
}
