#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int grid[n + 1][n + 1];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> grid[i][j];
    }
  }
  bool good = false;
  if (n == 1) {
    if (grid[0][0] <= 1) {
      good = true;
    }
  } else {
    for (int i = 0; i < n; i++) {
      bool breakAll = false;
      for (int j = 0; j < n; j++) {
        if (grid[i][j] > 1) {
          bool ok = false;
          for (int x = 0; x < n; x++) {
            for (int y = 0; y < n; y++) {
              if (grid[x][j] + grid[i][y] == grid[i][j]) {
                good = true;
                ok = true;
                break;
              }
            }
          }
          if (ok == 0) {
            good = false;
            breakAll = true;
            break;
          }
        }
      }
      if (breakAll) {
        break;
      }
    }
  }
  if (good) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
