#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
const long long int N = 100005;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  {
    long long int i, j, k, n, m, ans = 0, cnt = 0, sum = 0;
    cin >> n >> m;
    long long int a[n][m], b[n][m];
    for (i = 0; i < n; i++) {
      for (j = 0; j < m; j++) {
        cin >> a[i][j];
      }
    }
    for (i = 0; i < n; i++) {
      for (j = 0; j < m; j++) {
        cin >> b[i][j];
      }
    }
    for (i = 0; i < n; i++) {
      for (j = 0; j < m; j++) {
        if (a[i][j] > b[i][j]) {
          swap(a[i][j], b[i][j]);
        }
      }
    }
    bool bl = true;
    for (i = 0; i < n; i++) {
      for (j = 1; j < m; j++) {
        if (a[i][j] <= a[i][j - 1] || b[i][j] <= b[i][j - 1]) {
          bl = false;
        }
      }
    }
    for (i = 0; i < m; i++) {
      for (j = 1; j < n; j++) {
        if (a[j][i] <= a[j - 1][i] || b[j][i] <= b[j - 1][i]) {
          bl = false;
        }
      }
    }
    if (bl) {
      cout << "Possible";
    } else {
      cout << "Impossible";
    }
  }
}
