#include <bits/stdc++.h>
using namespace std;
template <class T>
std::istream& operator>>(std::istream& in, std::vector<T>& data) {
  for (auto& item : data) {
    in >> item;
  }
  return in;
}
template <class T>
std::ostream& operator<<(std::ostream& out, const std::vector<T>& data) {
  bool first = true;
  for (const auto& item : data) {
    if (!first) {
      out << " ";
    }
    out << item;
    first = false;
  }
  return out;
}
struct Graph {
  vector<vector<int>> data;
  vector<int> color;
  bool Dfs(int node) {
    bool res = false;
    for (int child : data[node]) {
      if (color[child] == -1) {
        color[child] = abs(1 - color[node]);
        res |= Dfs(child);
      } else if (color[child] == color[node]) {
        res = true;
      }
    }
    return res;
  }
};
int main() {
  int n, m;
  cin >> n >> m;
  vector<vector<int>> matrix_1(n);
  vector<vector<int>> matrix_2(n);
  for (int i = 0; i < n; ++i) {
    matrix_1[i].resize(m);
    cin >> matrix_1[i];
  }
  for (int i = 0; i < n; ++i) {
    matrix_2[i].resize(m);
    cin >> matrix_2[i];
  }
  vector<vector<int>> mask(n, vector<int>(m, 0));
  vector<vector<int>> res(n, vector<int>(m, 0));
  vector<vector<int>> res_2(n, vector<int>(m, 0));
  bool possible = true;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (i == 0 && j == 0) {
        mask[i][j] = (matrix_1[i][j] < matrix_2[i][j]) ? 0 : 1;
        res[i][j] = min(matrix_1[i][j], matrix_2[i][j]);
        res_2[i][j] = max(matrix_1[i][j], matrix_2[i][j]);
      } else if (j == 0) {
        if (matrix_1[i][j] > res[i - 1][j] && matrix_2[i][j] > res[i - 1][j]) {
          mask[i][j] = (matrix_1[i][j] < matrix_2[i][j]) ? 0 : 1;
          res[i][j] = min(matrix_1[i][j], matrix_2[i][j]);
          res_2[i][j] = max(matrix_1[i][j], matrix_2[i][j]);
        } else if (matrix_1[i][j] > res[i - 1][j]) {
          mask[i][j] = 0;
          res[i][j] = matrix_1[i][j];
          res_2[i][j] = matrix_2[i][j];
        } else if (matrix_2[i][j] > res[i - 1][j]) {
          mask[i][j] = 1;
          res[i][j] = matrix_2[i][j];
          res_2[i][j] = matrix_1[i][j];
        } else {
          possible = false;
        }
      } else if (i == 0) {
        if (matrix_1[i][j] > res[i][j - 1] && matrix_2[i][j] > res[i][j - 1]) {
          mask[i][j] = (matrix_1[i][j] < matrix_2[i][j]) ? 0 : 1;
          res[i][j] = min(matrix_1[i][j], matrix_2[i][j]);
          res_2[i][j] = max(matrix_1[i][j], matrix_2[i][j]);
        } else if (matrix_1[i][j] > res[i][j - 1]) {
          mask[i][j] = 0;
          res[i][j] = matrix_1[i][j];
          res_2[i][j] = matrix_2[i][j];
        } else if (matrix_2[i][j] > res[i][j - 1]) {
          mask[i][j] = 1;
          res[i][j] = matrix_2[i][j];
          res_2[i][j] = matrix_1[i][j];
        } else {
          possible = false;
        }
      } else {
        if (matrix_1[i][j] > res[i - 1][j] && matrix_2[i][j] > res[i - 1][j] &&
            matrix_1[i][j] > res[i][j - 1] && matrix_2[i][j] > res[i][j - 1]) {
          mask[i][j] = (matrix_1[i][j] < matrix_2[i][j]) ? 0 : 1;
          res[i][j] = min(matrix_1[i][j], matrix_2[i][j]);
          res_2[i][j] = max(matrix_1[i][j], matrix_2[i][j]);
        } else if (matrix_1[i][j] > res[i - 1][j] &&
                   matrix_1[i][j] > res[i][j - 1]) {
          mask[i][j] = 0;
          res[i][j] = matrix_1[i][j];
          res_2[i][j] = matrix_2[i][j];
        } else if (matrix_2[i][j] > res[i - 1][j] &&
                   matrix_2[i][j] > res[i][j - 1]) {
          mask[i][j] = 1;
          res[i][j] = matrix_2[i][j];
          res_2[i][j] = matrix_1[i][j];
        } else {
          possible = false;
        }
      }
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (i > 0 && j > 0) {
        if (res_2[i][j] <= res_2[i - 1][j] || res_2[i][j] <= res_2[i][j - 1]) {
          possible = false;
        }
      } else if (i == 0 && j > 0) {
        if (res_2[i][j] <= res_2[i][j - 1]) {
          possible = false;
        }
      } else if (i > 0 && j == 0) {
        if (res_2[i][j] <= res_2[i - 1][j]) {
          possible = false;
        }
      }
    }
  }
  if (possible) {
    cout << "Possible\n";
  } else {
    cout << "Impossible\n";
  }
  return 0;
}
