#include <bits/stdc++.h>
using namespace std;
int mp1[55][55];
int mp2[55][55];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> mp1[i][j];
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> mp2[i][j];
      if (mp2[i][j] < mp1[i][j]) {
        int t = mp1[i][j];
        mp1[i][j] = mp2[i][j];
        mp2[i][j] = t;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (i + 1 < n) {
        if (mp1[i + 1][j] <= mp1[i][j] || mp2[i + 1][j] <= mp2[i][j]) {
          puts("Impossible");
          return 0;
        }
      }
      if (j + 1 < m) {
        if (mp1[i][j + 1] <= mp1[i][j] || mp2[i][j + 1] <= mp2[i][j]) {
          puts("Impossible");
          return 0;
        }
      }
    }
  }
  puts("Possible");
  return 0;
}
