#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  fast();
  long long n, m, g1, g2;
  cin >> n >> m;
  long long a[n + 10][m + 10], b[n + 10][m + 10];
  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 (b[i][j] < a[i][j]) swap(a[i][j], b[i][j]);
    }
  }
  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";
        return 0;
      }
    }
  }
  for (int i = 2; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      if (a[i][j] <= a[i - 1][j] || b[i][j] <= b[i - 1][j]) {
        cout << "Impossible";
        return 0;
      }
    }
  }
  cout << "Possible";
  return 0;
}
