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