#include <bits/stdc++.h>
using namespace std;
long long int arr[1000][1000];
long long int arr2[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 >> arr[i][j];
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      cin >> arr2[i][j];
      if (arr[i][j] > arr2[i][j]) {
        swap(arr[i][j], arr2[i][j]);
      }
      if (arr[i][j - 1] >= arr[i][j] | arr[i][j] <= arr[i - 1][j]) {
        cout << "Impossible" << endl;
        return 0;
      }
      if (arr2[i][j - 1] >= arr2[i][j] | arr2[i][j] <= arr2[i - 1][j]) {
        cout << "Impossible" << endl;
        return 0;
      }
    }
  cout << "Possible" << endl;
}
