#include <bits/stdc++.h>
using namespace std;
long long int a[1000][1000];
long long int b[1000][1000];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) cin >> a[i][j];
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> b[i][j];
      if (a[i][j] > b[i][j]) swap(a[i][j], b[i][j]);
      if (a[i][j] <= a[i - 1][j] || a[i][j] <= a[i][j - 1] ||
          b[i][j] <= b[i - 1][j] || b[i][j] <= b[i][j - 1])
        return cout << "Impossible\n", 0;
    }
  }
  cout << "Possible\n";
}
