#include <bits/stdc++.h>
using namespace std;
int a[55][55], b[55][55];
int main() {
  int n, m;
  scanf("%d", &n);
  scanf("%d", &m);
  memset(a, 0, sizeof(a));
  memset(b, 0, sizeof(b));
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      scanf("%d", &a[i][j]);
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      scanf("%d", &b[i][j]);
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      int mn = min(a[i][j], b[i][j]);
      int mx = max(a[i][j], b[i][j]);
      if (mn > a[i][j - 1] && mx > b[i][j - 1]) {
        a[i][j] = mn;
        b[i][j] = mx;
      } else if (mx > a[i][j - 1] && mn > b[i][j - 1]) {
        a[i][j] = mx;
        b[i][j] = mn;
      } else {
        printf("Impossible");
        return 0;
      }
    }
  }
  for (int j = 1; j <= m; j++) {
    for (int i = 1; i <= n; i++) {
      int mn = min(a[i][j], b[i][j]);
      int mx = max(a[i][j], b[i][j]);
      if (mn > a[i - 1][j] && mx > b[i - 1][j] && mn > a[i][j - 1] &&
          mx > b[i][j - 1]) {
        a[i][j] = mn;
        b[i][j] = mx;
      } else if (mx > a[i - 1][j] && mn > b[i - 1][j] && mx > a[i][j - 1] &&
                 mn > b[i][j - 1]) {
        a[i][j] = mx;
        b[i][j] = mn;
      } else {
        printf("Impossible");
        return 0;
      }
    }
  }
  printf("Possible");
}
