#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
using namespace std;
long long int MOD = 1000000007;
double eps = 1e-12;
void solve();
long long int gcd(long long int a, long long int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
void solve() {
  long long int n, m;
  cin >> n >> m;
  long long int m1[n][m], m2[n][m];
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < m; j++) cin >> m1[i][j];
  }
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < m; j++) cin >> m2[i][j];
  }
  for (long long int i = 0; i < n; i++) {
    long long int temp = min(m1[i][0], m2[i][0]);
    m2[i][0] = max(m1[i][0], m2[i][0]);
    m1[i][0] = temp;
    for (long long int j = 1; j < m; j++) {
      if (m2[i][j] > m1[i][j - 1] && m1[i][j] > m1[i][j - 1]) {
        long long int temp = min(m1[i][j], m2[i][j]);
        m2[i][j] = max(m1[i][j], m2[i][j]);
        m1[i][j] = temp;
      } else if (m2[i][j] > m1[i][j - 1]) {
        swap(m2[i][j], m1[i][j]);
      }
    }
    for (long long int j = 1; j < m; j++) {
      if (m1[i][j] <= m1[i][j - 1] || m2[i][j] <= m2[i][j - 1]) {
        cout << "Impossible" << endl;
        return;
      }
    }
  }
  for (long long int i = 0; i < m; i++) {
    for (long long int j = 1; j < n; j++) {
      if (m1[j][i] <= m1[j - 1][i] || m2[j][i] <= m2[j - 1][i]) {
        cout << "Impossible" << endl;
        return;
      }
    }
  }
  cout << "Possible" << endl;
  return;
}
