#include <bits/stdc++.h>
using namespace std;
const int64_t Nmax = 2e5 + 10;
const int64_t mod = 1000000007;
vector<int64_t> prime;
int64_t is_power_of_two(int64_t a) { return a && (!(a & (a - 1))); }
int64_t isperfectsquare(int64_t a) {
  double b = sqrt(a);
  return (b - ceil(b) == 0);
}
int64_t pow(int64_t a, int64_t b, int64_t m) {
  a = a % m;
  int64_t res = 1;
  while (b > 0) {
    if (b & 1) {
      res = res * a % m;
    }
    a = a * a % m;
    b = b / 2;
  }
  return res;
}
int64_t mod_add(int64_t a, int64_t b, int64_t m) {
  a = a % m;
  b = b % m;
  return (((a + b) % m) + m) % m;
}
int64_t mod_mul(int64_t a, int64_t b, int64_t m) {
  a = a % m;
  b = b % m;
  return (((a * b) % m) + m) % m;
}
int64_t mod_sub(int64_t a, int64_t b, int64_t m) {
  a = a % m;
  b = b % m;
  return (((a - b) % m) + m) % m;
}
int64_t mod_div(int64_t a, int64_t b, int64_t m) {
  a = a % m;
  b = b % m;
  return (mod_mul(a, pow(b, m - 2, m), m));
}
void sieve(int64_t n) {
  bool isprime[n + 1];
  memset(isprime, true, sizeof(isprime));
  prime.push_back(2);
  for (int64_t i = 3; i <= sqrt(n); i += 2) {
    if (isprime[i]) {
      for (int64_t j = i * i; j <= n; j += i) {
        isprime[j] = false;
      }
    }
  }
  for (int64_t i = 3; i <= n; i += 2) {
    if (isprime[i]) {
      prime.push_back(i);
    }
  }
}
vector<pair<int64_t, int64_t>> Getprimefactors(int64_t n) {
  vector<pair<int64_t, int64_t>> pr;
  for (int64_t i = 2; i <= sqrt(n); i++) {
    int64_t cnt = 0;
    while (n % i == 0) {
      cnt++;
      n /= i;
    }
    if (cnt) pr.push_back({i, cnt});
  }
  if (n > 1) {
    pr.push_back({n, 1});
  }
  return pr;
}
void solve() {
  int64_t n, m, k, p, q, ans = 0;
  cin >> n >> m;
  vector<vector<int64_t>> a(n, vector<int64_t>(m)), b(n, vector<int64_t>(m));
  for (int64_t i = 0; i <= n - 1; i++) {
    for (int64_t j = 0; j <= m - 1; j++) {
      cin >> a[i][j];
    }
  }
  for (int64_t i = 0; i <= n - 1; i++) {
    for (int64_t j = 0; j <= m - 1; j++) {
      cin >> b[i][j];
    }
  }
  for (int64_t i = 0; i <= n - 1; i++) {
    for (int64_t j = 0; j <= m - 1; j++) {
      if (a[i][j] > b[i][j]) {
        swap(a[i][j], b[i][j]);
      }
    }
  }
  for (int64_t i = 0; i <= n - 1; i++) {
    for (int64_t j = 1; j <= m - 1; j++) {
      if (a[i][j] <= a[i][j - 1] || b[i][j] <= b[i][j - 1]) {
        cout << "Impossible\n";
        return;
      }
    }
  }
  for (int64_t j = 0; j <= m - 1; j++) {
    for (int64_t i = 1; i <= n - 1; i++) {
      if (a[i][j] <= a[i - 1][j] || b[i][j] <= b[i - 1][j]) {
        cout << "Impossible\n";
        return;
      }
    }
  }
  cout << "Possible";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int64_t t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
