#include <bits/stdc++.h>
using namespace std;
template <typename T>
void out(T x) {
  cout << x << endl;
  exit(0);
}
const int maxn = 55;
int n, m;
int a[maxn][maxn], b[maxn][maxn];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> 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];
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      int mn = min(a[i][j], b[i][j]);
      int mx = max(a[i][j], b[i][j]);
      a[i][j] = mn;
      b[i][j] = mx;
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (i > 0) {
        if (a[i][j] <= a[i - 1][j] || b[i][j] <= b[i - 1][j]) out("Impossible");
      }
      if (j > 0) {
        if (a[i][j] <= a[i][j - 1] || b[i][j] <= b[i][j - 1]) out("Impossible");
      }
    }
  }
  cout << "Possible" << endl;
  return 0;
}
