#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  int g[n][m][2];
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      cin >> g[i][j][0];
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      cin >> g[i][j][1];
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (g[i][j][1] > g[i][j][0]) {
        int temp = g[i][j][1];
        g[i][j][1] = g[i][j][0];
        g[i][j][0] = temp;
      }
    }
  }
  for (int i = 0; i < n; ++i) {
    int preva = -1, prevb = -1;
    for (int j = 0; j < m; ++j) {
      if (g[i][j][0] <= preva) {
        cout << "Impossible" << endl;
        return 0;
      }
      preva = g[i][j][0];
      if (g[i][j][1] <= prevb) {
        cout << "Impossible" << endl;
        return 0;
      }
      prevb = g[i][j][1];
    }
  }
  for (int j = 0; j < m; ++j) {
    int preva = -1, prevb = -1;
    for (int i = 0; i < n; ++i) {
      if (g[i][j][0] <= preva) {
        cout << "Impossible" << endl;
        return 0;
      }
      preva = g[i][j][0];
      if (g[i][j][1] <= prevb) {
        cout << "Impossible" << endl;
        return 0;
      }
      prevb = g[i][j][1];
    }
  }
  cout << "Possible" << endl;
  return 0;
}
