#include <bits/stdc++.h>
using namespace std;
const long long dx[4] = {-1, 0, 0, 1};
const long long dy[4] = {0, -1, 1, 0};
const long long INF = 1e18;
const long long mod = 1000000007;
void faster() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
long long a, b, n, m, x, k, c, d, y, z, ans, i, cnt;
long long br[1456789], ar[1456789], mn[1456789], mx[1456789], used[1456789],
    h[55][55], p[55][55];
string s, t;
set<long long> ss(), mm;
vector<pair<long long, long long> > vv;
vector<long long> vec[1456789];
map<long long, long long> mmap;
bool ok;
long long gcd(long long a, long long b) {
  if (a == 0)
    return b;
  else
    return gcd(b % a, a);
}
long long dfs(long long i) {
  used[i] = d;
  cnt++;
  for (long long j = 0; j < vec[i].size(); j++) {
    if (!used[vec[i][j]]) dfs(vec[i][j]);
  }
}
void dii() {
  faster();
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> h[i][j];
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> p[i][j];
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (h[i][j] > p[i][j]) swap(h[i][j], p[i][j]);
      if (h[i][j] <= h[i - 1][j] || h[i][j] <= h[i][j - 1] ||
          p[i][j] <= p[i - 1][j] || p[i][j] <= p[i][j - 1]) {
        cout << "Impossible";
        return;
      }
    }
  }
  cout << "Possible";
}
int main() {
  faster();
  int q = 1;
  while (q--) {
    dii();
  }
  return 0;
}
