#include <bits/stdc++.h>
using namespace std;
int n, m, a[105][105], b[105][105];
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      scanf("%d", &a[i][j]);
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      scanf("%d", &b[i][j]);
      if (a[i][j] > b[i][j]) swap(a[i][j], b[i][j]);
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 1; j < m; j++) {
      if (a[i][j] <= a[i][j - 1] || b[i][j] <= b[i][j - 1]) {
        printf("Impossible\n");
        return 0;
      }
      if (i > 0) {
        if (a[i][j] <= a[i - 1][j] || b[i][j] <= b[i - 1][j]) {
          printf("Impossible\n");
          return 0;
        }
      }
    }
    if (i > 0) {
      if (a[i][0] <= a[i - 1][0] || b[i][0] <= b[i - 1][0]) {
        printf("Impossible\n");
        return 0;
      }
    }
  }
  printf("Possible\n");
}
