#include <bits/stdc++.h>
using namespace std;
int main() {
  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];
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      int mini = min(a[i][j], b[i][j]);
      int maxi = max(a[i][j], b[i][j]);
      a[i][j] = mini;
      b[i][j] = maxi;
    }
  }
  bool ok = true;
  for (int i = 0; i < n && ok; ++i) {
    for (int j = 0; j < m - 1; ++j) {
      if (a[i][j] >= a[i][j + 1]) {
        ok = false;
        break;
      }
    }
  }
  for (int i = 0; i < n && ok; ++i) {
    for (int j = 0; j < m - 1; ++j) {
      if (b[i][j] >= b[i][j + 1]) {
        ok = false;
        break;
      }
    }
  }
  for (int j = 0; j < m && ok; ++j) {
    for (int i = 0; i < n - 1; ++i) {
      if (a[i][j] >= a[i + 1][j]) {
        ok = false;
        break;
      }
    }
  }
  for (int j = 0; j < m && ok; ++j) {
    for (int i = 0; i < n - 1; ++i) {
      if (b[i][j] >= b[i + 1][j]) {
        ok = false;
        break;
      }
    }
  }
  if (ok)
    cout << "Possible";
  else
    cout << "Impossible";
  return 0;
}
