#include <bits/stdc++.h>
using namespace std;
int a[51][51], b[51][51];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> a[i][j];
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> b[i][j];
      if (a[i][j] > b[i][j]) {
        int temp;
        temp = a[i][j];
        a[i][j] = b[i][j];
        b[i][j] = temp;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 2; j <= m; j++) {
      if (a[i][j] <= a[i][j - 1] || b[i][j] <= b[i][j - 1]) {
        cout << "Impossible" << endl;
        return 0;
      }
    }
  }
  for (int j = 1; j <= m; j++) {
    for (int i = 2; i <= n; i++) {
      if (a[i][j] <= a[i - 1][j] || b[i][j] <= b[i - 1][j]) {
        cout << "Impossible" << endl;
        return 0;
      }
    }
  }
  cout << "Possible" << endl;
  return 0;
}
