#include <bits/stdc++.h>
using namespace std;
pair<int, int> ii;
pair<long long, long long> ll;
const int N = 55;
int a[N][N];
int n;
bool get(int x, int y) {
  if (a[x][y] == 1) return true;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (a[x][y] == a[x][j] + a[i][y]) return true;
    }
  }
  return false;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      scanf("%d", &a[i][j]);
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (!get(i, j)) {
        puts("No");
        return 0;
      }
    }
  }
  puts("Yes");
  return 0;
}
