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