#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<vector<int>> a(n, vector<int>(m)), b(n, vector<int>(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 mx = max(a[i][j], b[i][j]);
      int mn = min(a[i][j], b[i][j]);
      a[i][j] = mx;
      b[i][j] = mn;
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (i > 0) {
        if (a[i][j] <= a[i - 1][j] || b[i][j] <= b[i - 1][j]) {
          cout << "Impossible";
          return 0;
        }
      }
      if (j > 0) {
        if (a[i][j] <= a[i][j - 1] || b[i][j] <= b[i][j - 1]) {
          cout << "Impossible";
          return 0;
        }
      }
    }
  }
  cout << "Possible";
}
