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