#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("avx2")
using namespace std;
const long long INF = 2e18 + 100;
const long long MOD = 1e9 + 7;
const long long N = 500;
const long long nul = 0;
const long long SIZE = 1e6 * 3;
const long double pi = atan2(0, -1);
signed main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
  long long n, m;
  cin >> n >> m;
  vector<vector<long long> > a(n + 1, vector<long long>(m + 1, 0));
  vector<vector<long long> > b = a;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= m; j++) {
      cin >> a[i][j];
    }
  }
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= m; j++) {
      cin >> b[i][j];
    }
  }
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= m; j++) {
      if (a[i][j] > b[i][j]) swap(a[i][j], b[i][j]);
    }
  }
  bool flag = 1;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= m; j++) {
      if (a[i][j] > a[i - 1][j] && a[i][j] > a[i][j - 1] &&
          b[i][j] > b[i - 1][j] && b[i][j] > b[i][j - 1]) {
        continue;
      } else {
        flag = 0;
      }
    }
  }
  if (flag == 0) {
    cout << "Impossible\n";
  } else {
    cout << "Possible\n";
  }
}
