#include <bits/stdc++.h>
using namespace std;
const long long MOD = (long long)1e9 + 7;
const int N = 1e5 + 5, inf = 1e9 + 5;
long long add(long long x, long long y) {
  x += y;
  if (x >= MOD) return x - MOD;
  return x;
}
long long sub(long long x, long long y) {
  x -= y;
  if (x < 0) return x + MOD;
  return x;
}
long long mult(long long x, long long y) { return (x * y) % MOD; }
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m;
  cin >> n >> m;
  vector<vector<int>> a(n, vector<int>(m)), b(n, vector<int>(m)),
      c(n, vector<int>(m)), d(n, vector<int>(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++) c[i][j] = min(a[i][j], b[i][j]);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) d[i][j] = max(a[i][j], b[i][j]);
  bool ok = true;
  for (int i = 0; i < n; ++i) {
    for (int j = 1; j < m; ++j) {
      if (c[i][j] <= c[i][j - 1]) ok = false;
      if (d[i][j] <= d[i][j - 1]) ok = false;
    }
  }
  for (int j = 0; j < m; ++j) {
    for (int i = 1; i < n; ++i) {
      if (c[i][j] <= c[i - 1][j]) ok = false;
      if (d[i][j] <= d[i - 1][j]) ok = false;
    }
  }
  if (ok)
    cout << "Possible" << endl;
  else
    cout << "Impossible" << endl;
}
