#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n, m;
  cin >> n >> m;
  vector<vector<long long> > was(n, vector<long long>(m)),
      will(n, vector<long long>(m));
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      cin >> was[i][j];
    }
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      cin >> will[i][j];
    }
  }
  bool ok = true;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      long long a = was[i][j], b = will[i][j];
      was[i][j] = min(a, b);
      will[i][j] = max(a, b);
    }
  }
  for (long long j = 0; j < m; j++) {
    for (long long i = 1; i < n; i++) {
      if (was[i - 1][j] < was[i][j] && will[i - 1][j] < will[i][j]) continue;
      ok = false;
    }
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 1; j < m; j++) {
      if (was[i][j - 1] < was[i][j] && will[i][j - 1] < will[i][j]) continue;
      ok = false;
    }
  }
  if (!ok) {
    cout << "Impossible" << endl;
    return 0;
  }
  cout << "Possible" << endl;
  return 0;
}
