#include <bits/stdc++.h>
using namespace std;
bool isIncreasing(vector<vector<int>> &arr) {
  for (int i = 0; i < arr.size(); i++) {
    for (int j = 0; j + 1 < arr[i].size(); j++) {
      if (arr[i][j + 1] <= arr[i][j]) return false;
    }
  }
  for (int i = 0; i + 1 < arr.size(); i++) {
    for (int j = 0; j < arr[i].size(); j++) {
      if (arr[i + 1][j] <= arr[i][j]) return false;
    }
  }
  return true;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, m, i, j;
  cin >> n >> m;
  vector<vector<int>> a(n), b(n);
  for (__typeof(i) i = 0; i < n; i++) {
    vector<int> row1(m), row2(m);
    a[i] = row1;
    b[i] = row2;
  }
  for (__typeof(i) i = 0; i < n; i++) {
    for (__typeof(j) j = 0; j < m; j++) {
      cin >> a[i][j];
    }
  }
  for (__typeof(i) i = 0; i < n; i++) {
    for (__typeof(j) j = 0; j < m; j++) {
      cin >> b[i][j];
    }
  }
  for (__typeof(i) i = 0; i < n; i++) {
    for (__typeof(j) j = 0; j < m; j++) {
      if (a[i][j] > b[i][j]) {
        int temp = a[i][j];
        a[i][j] = b[i][j];
        b[i][j] = temp;
      }
    }
  }
  if (isIncreasing(a) && isIncreasing(b))
    cout << "Possible" << endl;
  else
    cout << "Impossible" << endl;
  return 0;
}
