#include <bits/stdc++.h>
using namespace std;
long long int n, m, k, x;
long long int arr[51][51];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> arr[i][j];
    }
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      if (arr[i][j] == 1) continue;
      bool f = 0;
      {
        for (int x = 0; x < n; x++) {
          for (int y = 0; y < n; y++) {
            if (arr[i][x] + arr[y][j] == arr[i][j]) {
              f = 1;
              break;
            }
          }
          if (f) break;
        }
      }
      if (!f) {
        cout << "No";
        return 0;
      }
    }
  cout << "Yes";
  return 0;
}
