#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long int n, m, i, j;
  cin >> n >> m;
  long long int a[n + 1][m + 1], b[n + 1][m + 1];
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) scanf("%lld", &a[i][j]);
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) scanf("%lld", &b[i][j]);
  }
  bool flag = true;
  for (i = 1; i <= n; i++) {
    long long int a1[m + 1], a2[m + 1];
    a1[0] = 0, a2[0] = 0;
    for (j = 1; j <= m; j++) {
      long long int ma = max(a[i][j], b[i][j]);
      long long int mi = min(a[i][j], b[i][j]);
      a1[j] = ma, a2[j] = mi;
    }
    for (j = 0; j < m; j++) {
      if (a1[j] >= a1[j + 1] || a2[j] >= a2[j + 1]) flag = false;
    }
  }
  for (j = 1; j <= m; j++) {
    long long int a1[n + 1], a2[n + 1];
    a1[0] = 0, a2[0] = 0;
    for (i = 1; i <= n; i++) {
      long long int ma = max(a[i][j], b[i][j]);
      long long int mi = min(a[i][j], b[i][j]);
      a1[i] = ma, a2[i] = mi;
    }
    for (i = 0; i < n; i++) {
      if (a1[i] >= a1[i + 1] || a2[i] >= a2[i + 1]) flag = false;
    }
  }
  if (flag)
    printf("Possible\n");
  else
    printf("Impossible\n");
  return 0;
}
