#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
constexpr int INF = (1 << 30);
constexpr ll INFL = (1ll << 60);
constexpr ll MOD = 1000000007;
int main() {
  int n, m;
  cin >> n >> m;
  vector<vector<ll>> a(n, vector<ll>(m)), b(n, vector<ll>(m));
  for (ll((i)) = (0); ((i)) < ((n)); ((i))++)
    for (ll((j)) = (0); ((j)) < ((m)); ((j))++) cin >> a[i][j];
  for (ll((i)) = (0); ((i)) < ((n)); ((i))++)
    for (ll((j)) = (0); ((j)) < ((m)); ((j))++) cin >> b[i][j];
  for (ll((i)) = (0); ((i)) < ((n)); ((i))++)
    for (ll((j)) = (0); ((j)) < ((m)); ((j))++)
      if (a[i][j] > b[i][j]) swap(a[i][j], b[i][j]);
  for (ll((i)) = (0); ((i)) < ((n)); ((i))++)
    for (ll((j)) = (0); ((j)) < ((m)); ((j))++) {
      if (i != 0) {
        if (a[i - 1][j] >= a[i][j]) goto fail;
        if (b[i - 1][j] >= b[i][j]) goto fail;
      }
      if (j != 0) {
        if (a[i][j - 1] >= a[i][j]) goto fail;
        if (b[i][j - 1] >= b[i][j]) goto fail;
      }
    }
  cout << "Possible" << endl;
  return 0;
fail:;
  cout << "Impossible" << endl;
  return 0;
}
