#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long n, m;
  cin >> n >> m;
  long long a[n][m], b[n][m];
  pair<long long, long long> p[n][m];
  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];
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < m; j++) {
      if (a[i][j] < b[i][j])
        p[i][j] = make_pair(a[i][j], b[i][j]);
      else
        p[i][j] = make_pair(b[i][j], a[i][j]);
    }
  for (long long i = 0; i < n; i++)
    for (long long j = 1; j < m; j++)
      if (p[i][j].first <= p[i][j - 1].first ||
          p[i][j].second <= p[i][j - 1].second) {
        cout << "Impossible\n";
        return 0;
      }
  for (long long i = 0; i < m; i++)
    for (long long j = 1; j < n; j++)
      if (p[j][i].first <= p[j - 1][i].first ||
          p[j][i].second <= p[j - 1][i].second) {
        cout << "Impossible\n";
        return 0;
      }
  cout << "Possible\n";
  return 0;
}
