#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  long long int arr[n][m], arr1[n][m];
  for (int i = 0; i <= n - 1; i++) {
    for (int j = 0; j <= m - 1; j++) {
      cin >> arr[i][j];
    }
  }
  for (int i = 0; i <= n - 1; i++) {
    for (int j = 0; j <= m - 1; j++) {
      cin >> arr1[i][j];
    }
  }
  for (int i = 0; i <= n - 1; i++) {
    for (int j = 0; j <= m - 1; j++) {
      if (arr[i][j] <= arr1[i][j])
        continue;
      else {
        long long int temp = arr[i][j];
        arr[i][j] = arr1[i][j];
        arr1[i][j] = temp;
      }
    }
  }
  for (int i = 0; i <= n - 1; i++) {
    for (int j = 0; j <= m - 2; j++) {
      if (arr[i][j] < arr[i][j + 1] && arr1[i][j] < arr1[i][j + 1])
        continue;
      else {
        cout << "Impossible";
        return 0;
      }
    }
  }
  for (int i = 0; i <= m - 1; i++) {
    for (int j = 0; j <= n - 2; j++) {
      if (arr[j][i] < arr[j + 1][i] && arr1[j][i] < arr1[j + 1][i])
        continue;
      else {
        cout << "Impossible";
        return 0;
      }
    }
  }
  cout << "Possible";
}
