#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int row, col;
  cin >> row >> col;
  int low[row][col], high[row][col], counter = 0;
  for (int i = 0; i < row; i++) {
    for (int j = 0; j < col; j++) {
      cin >> low[i][j];
    }
  }
  for (int i = 0; i < row; i++) {
    for (int j = 0; j < col; j++) {
      cin >> high[i][j];
    }
  }
  for (int i = 0; i < row; i++) {
    for (int j = 0; j < col; j++) {
      if (low[i][j] > high[i][j]) {
        swap(low[i][j], high[i][j]);
      }
    }
  }
  for (int i = 0; i < row; i++) {
    for (int j = 1; j < col; j++) {
      if (low[i][j] <= low[i][j - 1]) {
        cout << "Impossible"
             << "\n";
        return 0;
      }
    }
  }
  for (int j = 0; j < col; j++) {
    for (int i = 1; i < row; i++) {
      if (low[i][j] <= low[i - 1][j]) {
        cout << "Impossible"
             << "\n";
        return 0;
      }
    }
  }
  for (int i = 0; i < row; i++) {
    for (int j = 1; j < col; j++) {
      if (high[i][j] <= high[i][j - 1]) {
        cout << "Impossible"
             << "\n";
        return 0;
      }
    }
  }
  for (int j = 0; j < col; j++) {
    for (int i = 1; i < row; i++) {
      if (high[i][j] <= high[i - 1][j]) {
        cout << "Impossible"
             << "\n";
        return 0;
      }
    }
  }
  cout << "Possible"
       << "\n";
  return 0;
}
