#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n][n];
  bool isPerfect = false;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> arr[i][j];
    }
  }
  if (n == 1) {
    if (arr[0][0] == 1) {
      cout << "Yes";
    } else {
      cout << "No";
    }
    return 0;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      isPerfect = false;
      for (int k = 0; k < n; k++) {
        if (k == j) {
          continue;
        }
        for (int l = 0; l < n; l++) {
          if (l == i) {
            continue;
          }
          if (arr[i][j] != 1) {
            if (arr[i][k] + arr[l][j] == arr[i][j]) {
              isPerfect = true;
              break;
            }
          } else {
            if (arr[i][k] == arr[i][j] || arr[l][j] == arr[i][j]) {
              isPerfect = true;
              break;
            }
          }
        }
      }
      if (!isPerfect) {
        cout << "No";
        return 0;
      }
    }
  }
  cout << "Yes";
  return 0;
}
