#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  vector<vector<long long>> v1(n, vector<long long>(m)),
      v(n, vector<long long>(m));
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      cin >> v[i][j];
    }
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      cin >> v1[i][j];
    }
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      if (v[i][j] < v1[i][j]) {
        swap(v[i][j], v1[i][j]);
      }
    }
  }
  for (long long i = 0; i < n; i++) {
    if (i != 0) {
      for (long long j = 0; j < m - 1; j++) {
        if (v[i][j] <= v[i - 1][j] || v1[i][j] <= v1[i - 1][j]) {
          cout << "Impossible";
          return 0;
        }
        if (v[i][j] >= v[i][j + 1] || v1[i][j] >= v1[i][j + 1]) {
          cout << "Impossible";
          return 0;
        }
      }
      if (v[i][m - 1] <= v[i - 1][m - 1] || v1[i][m - 1] <= v1[i - 1][m - 1]) {
        cout << "Impossible";
        return 0;
      }
    } else {
      for (long long j = 0; j < m - 1; j++) {
        if (v[i][j] >= v[i][j + 1] || v1[i][j] >= v1[i][j + 1]) {
          cout << "Impossible";
          return 0;
        }
      }
    }
  }
  cout << "Possible";
}
