#include <bits/stdc++.h>
using namespace std;
const long long N = 55;
int a[N][N], b[N][N], c[N][N], d[N][N];
int 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];
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) cin >> b[i][j];
  }
  int flag = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      c[i][j] = min(a[i][j], b[i][j]);
      d[i][j] = max(a[i][j], b[i][j]);
    }
  }
  if (n == 1) {
    for (int i = 1; i < m; i++) {
      if (c[1][i] >= c[1][i + 1] || d[1][i] >= d[1][i + 1]) {
        flag = 1;
        break;
      }
    }
  } else if (m == 1) {
    for (int i = 1; i < n; i++) {
      if (c[i][1] >= c[i + 1][1] || d[i][1] >= d[i + 1][1]) {
        flag = 1;
        break;
      }
    }
  } else {
    for (int i = 1; i < n; i++) {
      for (int j = 1; j < m; j++) {
        if (c[i][j] >= c[i][j + 1] || d[i][j] >= d[i][j + 1] ||
            c[i + 1][j] <= c[i][j] || d[i + 1][j] <= d[i][j]) {
          flag = 1;
          break;
        }
      }
    }
    for (int i = 1; i < m; i++) {
      if (c[n][i] >= c[n][i + 1] || d[n][i] >= d[n][i + 1]) {
        flag = 1;
        break;
      }
    }
    for (int i = 1; i < n; i++) {
      if (c[i][m] >= c[i + 1][m] || d[i][m] >= d[i + 1][m]) {
        flag = 1;
        break;
      }
    }
  }
  if (flag == 1)
    cout << "Impossible" << endl;
  else
    cout << "Possible" << endl;
  return 0;
}
