#include <bits/stdc++.h>
using namespace std;
const int N = 5e2 + 7;
int n, m;
int A[N][N], B[N][N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> 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 = 1; j < m; ++j) {
      if (A[i][j - 1] >= A[i][j] || B[i][j - 1] >= B[i][j]) {
        cout << "Impossible\n";
        return 0;
      }
    }
  }
  for (int i = 1; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (A[i - 1][j] >= A[i][j] || B[i - 1][j] >= B[i][j]) {
        cout << "Impossible\n";
        return 0;
      }
    }
  }
  cout << "Possible\n";
  return 0;
}
