#include <bits/stdc++.h>
using namespace std;
long long min(long long a, long long b) {
  if (a > b)
    return b;
  else
    return a;
}
long long max(long long a, long long b) {
  if (a > b)
    return a;
  else
    return b;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  t = 1;
  while (t--) {
    int n, m;
    cin >> n >> m;
    long long a[n][m], b[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        cin >> a[i][j];
      }
    }
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        cin >> b[i][j];
      }
    }
    int f = 0;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        long long l, r;
        l = a[i][j];
        r = b[i][j];
        a[i][j] = min(l, r);
        b[i][j] = max(l, r);
        if (i > 0 && a[i][j] <= a[i - 1][j]) f = 1;
        if (i > 0 && b[i][j] <= b[i - 1][j]) f = 1;
        if (j > 0 && a[i][j] <= a[i][j - 1]) f = 1;
        if (j > 0 && b[i][j] <= b[i][j - 1]) f = 1;
      }
    }
    if (f)
      cout << "Impossible";
    else
      cout << "Possible";
  }
  return 0;
}
