#include <bits/stdc++.h>
using namespace std;
long long n, m, x, y, a, b, t;
long long q[55][55];
long long g[55][55];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) cin >> q[i][j];
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      cin >> g[i][j];
      if (g[i][j] < q[i][j]) swap(g[i][j], q[i][j]);
      if (q[i][j] <= q[i - 1][j] || q[i][j] <= q[i][j - 1]) t = 1;
      if (g[i][j] <= g[i - 1][j] || g[i][j] <= g[i][j - 1]) t = 1;
    }
  if (t == 1)
    cout << "Impossible";
  else
    cout << "Possible";
  return 0;
}
