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