#include <bits/stdc++.h>
using namespace std;
vector<long long> prime;
bool primes[1234567 + 1];
long long cntp[1234567 + 1];
void sv() {
  for (long long i = 2; i <= 1234567; i++) primes[i] = true;
  for (long long i = 2; i <= 1234567; i++) {
    if (primes[i]) {
      cntp[i] = 1;
      for (long long j = 2 * i; j <= 1234567; j += i) {
        primes[j] = false;
        cntp[j]++;
      }
      prime.push_back(i);
    }
  }
}
long long fexp(long long base, long long exp) {
  long long res = 1;
  while (exp > 0) {
    if (exp % 2 == 1) res = (res % 1000000007 * base % 1000000007) % 1000000007;
    base = (base % 1000000007 * base % 1000000007) % 1000000007;
    exp /= 2;
  }
  return res % 1000000007;
}
long long sod(long long num) {
  long long res = 0;
  while (num) {
    res += num % 10;
    num /= 10;
  }
  return res;
}
void nxp(string s) {
  do {
    cout << s << "\n";
  } while (next_permutation(s.begin(), s.end()));
}
long long table[1234567 + 1];
void coinways(long long n) {
  long long coins[] = {1, 2, 3, 4};
  table[0] = 1;
  for (long long i = 0; i < (sizeof(coins) / sizeof(coins[0])); i++) {
    for (long long j = coins[i]; j <= 1234567; j++) {
      table[j] += table[j - coins[i]];
    }
  }
  cout << table[n];
}
void coinmin(long long n) {
  long long coins[] = {1, 2, 3, 4};
  table[0] = 0;
  for (long long i = (1); i < (1 + 1234567); ++i) table[i] = INT_MAX;
  for (long long i = 1; i <= 1234567; i++) {
    for (long long j = 0; j < (sizeof(coins) / sizeof(coins[0])); j++) {
      if (i - coins[j] > 0) {
        long long res = table[i - coins[j]];
        if (res != INT_MAX && res + 1 < table[i]) {
          table[i] = res + 1;
        }
      }
    }
  }
  cout << table[n];
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0);
  sv();
  long long(n);
  cin >> n;
  long long a[n][n];
  for (long long i = 0; i < (n); ++i) {
    for (long long j = 0; j < (n); ++j) {
      cin >> a[i][j];
    }
  }
  if (n < 2) {
    if (a[0][0] != 1)
      cout << "No";
    else
      cout << "Yes";
    return 0;
  }
  long long flag = 0;
  for (long long i = 0; i < (n); ++i) {
    for (long long j = 0; j < (n); ++j) {
      if (a[i][j] == 1) continue;
      for (long long k = 0; k < (n); ++k) {
        if (k == j) continue;
        long long sum = a[i][k];
        for (long long h = 0; h < (n); ++h) {
          if (h == i) continue;
          if (sum + a[h][j] == a[i][j]) {
            flag = 1;
            break;
          } else
            flag = 2;
        }
        if (flag == 1) break;
      }
      if (flag == 2) {
        cout << "No";
        return 0;
      }
      flag = 0;
    }
  }
  cout << "Yes";
  return 0;
  return 0;
}
