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