#include <bits/stdc++.h>
using namespace std;
int main() {
  int m = 0, n = 0;
  bool flag = true, ch = true;
  ;
  cin >> m >> n;
  int a[m][n];
  int b[m][n];
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      cin >> a[i][j];
    }
  }
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      cin >> b[i][j];
    }
  }
  for (int i = 0; flag && i < m; i++) {
    for (int j = 0; flag && j < n; j++) {
      if (a[i][j] > b[i][j]) {
        swap(a[i][j], b[i][j]);
      }
    }
  }
  for (int i = 0; flag && i < m; i++) {
    for (int j = 0; flag && j < n; j++) {
      if ((j + 1 < n && (a[i][j] >= a[i][j + 1] || b[i][j] >= b[i][j + 1])) ||
          (i + 1 < m && (a[i][j] >= a[i + 1][j] || b[i][j] >= b[i + 1][j]))) {
        flag = false;
        break;
      }
    }
  }
  if (flag) {
    cout << "Possible\n";
  } else {
    cout << "Impossible\n";
  }
}
