#include <bits/stdc++.h>
using namespace std;
int n, m, a[50][50], b[50][50];
int main() {
  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];
      if (b[i][j] < a[i][j]) {
        swap(a[i][j], b[i][j]);
      }
    }
  }
  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" << endl;
        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" << endl;
        return 0;
      }
    }
  }
  cout << "Possible" << endl;
}
