#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int main() {
  int n, m;
  long long a[55][55], b[55][55];
  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 x = a[i][j], y = b[i][j];
      a[i][j] = min(x, y);
      b[i][j] = max(x, y);
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m - 1; j++) {
      if (a[i][j] >= a[i][j + 1] || b[i][j] >= b[i][j + 1]) {
        cout << "Impossible";
        return 0;
      }
    }
  }
  for (int i = 0; i < n - 1; i++) {
    for (int j = 0; j < m; j++) {
      if (a[i][j] >= a[i + 1][j] || b[i][j] >= b[i + 1][j]) {
        cout << "Impossible";
        return 0;
      }
    }
  }
  cout << "Possible";
  return 0;
}
