#include <bits/stdc++.h>
using namespace std;
template <class T>
int getbit(T s, int i) {
  return (s >> i) & 1;
}
template <class T>
T onbit(T s, int i) {
  return s | (T(1) << i);
}
template <class T>
T offbit(T s, int i) {
  return s & (~(T(1) << i));
}
template <class T>
int cntbit(T s) {
  return __builtin_popcount(s);
}
template <class T>
inline T gcd(T a, T b) {
  T r;
  while (b != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
long long n, m, a[55][55], b[55][55];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  for (long long i = 1, _b = n; i <= _b; i++)
    for (long long j = 1, _b = m; j <= _b; j++) cin >> a[i][j];
  for (long long i = 1, _b = n; i <= _b; i++)
    for (long long j = 1, _b = m; j <= _b; j++) cin >> b[i][j];
  for (long long i = 1, _b = n; i <= _b; i++)
    for (long long j = 1, _b = m; j <= _b; j++) {
      long long mi1 = min(a[i - 1][j], b[i - 1][j]),
                ma1 = max(a[i - 1][j], b[i - 1][j]);
      long long mi0 = min(a[i][j - 1], b[i][j - 1]),
                ma0 = max(a[i][j - 1], b[i][j - 1]);
      long long mi2 = min(a[i][j], b[i][j]), ma2 = max(a[i][j], b[i][j]);
      if (mi2 <= mi1 || mi2 <= mi0 || ma2 <= ma1 || ma2 <= ma0) {
        cout << "Impossible";
        return 0;
      }
    }
  cout << "Possible";
  return 0;
}
