#include <bits/stdc++.h>
using namespace std;
void init() {
  cin.tie(0);
  cin.sync_with_stdio(0);
  cout.tie(0);
}
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
int x[55][55], y[55][55];
int main() {
  init();
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> x[i][j];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      cin >> y[i][j];
      if (y[i][j] < x[i][j]) swap(x[i][j], y[i][j]);
    }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m - 1; j++)
      if (x[i][j] >= x[i][j + 1] || y[i][j] >= y[i][j + 1])
        return cout << "Impossible", 0;
  for (int j = 0; j < m; j++)
    for (int i = 0; i < n - 1; i++)
      if (x[i][j] >= x[i + 1][j] || y[i][j] >= y[i + 1][j])
        return cout << "Impossible", 0;
  cout << "Possible";
}
