#include <bits/stdc++.h>
using namespace std;
void check(vector<vector<long long> >& a, vector<vector<long long> >& b) {
  long long n = a.size(), m = a[0].size();
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < m; j++)
      if (a[i][j] > b[i][j]) swap(a[i][j], b[i][j]);
}
bool correct(vector<vector<long long> > a) {
  long long n = a.size(), m = a[0].size();
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      if ((i + 1 < n && a[i][j] >= a[i + 1][j]) ||
          (j + 1 < m && a[i][j] >= a[i][j + 1]) ||
          (i - 1 >= 0 && a[i][j] <= a[i - 1][j]) ||
          (j - 1 >= 0 && a[i][j] <= a[i][j - 1]))
        return false;
    }
  }
  return true;
}
int32_t main() {
  long long n, m;
  cin >> n >> m;
  vector<vector<long long> > a(n, vector<long long>(m, 0)),
      b(n, vector<long long>(m, 0));
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < m; j++) cin >> a[i][j];
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < m; j++) cin >> b[i][j];
  check(a, b);
  if (correct(a) && correct(b))
    cout << "Possible\n";
  else
    cout << "Impossible\n";
}
