#include <bits/stdc++.h>
using namespace std;
const int inf = (1e7);
const long long inf2 = (long long)1e9 + 7;
const long long bs = (long long)239;
const int C = 2 * (1e5) + 10;
int n, m;
bool good(vector<vector<int> > &a) {
  for (int i = 0; i < n; ++i)
    for (int j = 0; j + 1 < m; ++j)
      if (a[i][j + 1] <= a[i][j]) return 0;
  for (int j = 0; j < m; ++j)
    for (int i = 0; i + 1 < n; ++i)
      if (a[i + 1][j] <= a[i][j]) return 0;
  return 1;
}
int main() {
  cin >> n >> m;
  vector<vector<int> > a(n, vector<int>(m)), b(n, vector<int>(m));
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j) cin >> a[i][j];
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j) cin >> b[i][j];
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j) {
      int x = a[i][j], y = b[i][j];
      a[i][j] = min(y, x);
      b[i][j] = max(x, y);
    }
  if (good(a) && good(b))
    cout << "Possible";
  else
    cout << "Impossible";
  return 0;
}
