#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  long long a[n][m], b[n][m];
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < m; j++) cin >> a[i][j];
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < m; j++) cin >> b[i][j];
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      if (a[i][j] > b[i][j]) swap(a[i][j], b[i][j]);
    }
  }
  bool chk = 0;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      if (i - 1 >= 0 && (a[i - 1][j] >= a[i][j] || b[i - 1][j] >= b[i][j]))
        chk = 1;
      if (j - 1 >= 0 && (a[i][j - 1] >= a[i][j] || b[i][j - 1] >= b[i][j]))
        chk = 1;
    }
  }
  if (chk) {
    cout << "Impossible\n";
  } else {
    cout << "Possible";
  }
  return 0;
}
