#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  int arr[n][n];
  int i, j;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) scanf("%d", &arr[i][j]);
  }
  int k, l, counter = 0, final_counter = 0;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (arr[i][j] != 1) {
        for (k = 0; k < n; k++) {
          for (l = 0; l < n; l++) {
            if (arr[i][k] + arr[l][j] == arr[i][j]) {
              counter = 1;
              break;
            }
          }
          if (counter == 1) break;
        }
        if (counter == 0) {
          final_counter = 1;
        }
      }
      if (final_counter == 1) break;
      counter = 0;
    }
    if (final_counter == 1) break;
  }
  if (final_counter == 1)
    printf("No\n");
  else
    printf("Yes\n");
  return 0;
}
