#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k = 0, k1 = 0, c = 0, i, j, f = 0, l;
  cin >> n >> m;
  if (n == 1 || m == 1) {
    if (n == 1)
      l = m;
    else
      l = n;
    int x[l + 10], y[l + 10];
    for (i = 0; i < l; i++) cin >> x[i];
    for (i = 0; i < l; i++) cin >> y[i];
    for (i = 0; i < l - 1; i++) {
      if (x[i + 1] <= x[i]) {
        if (y[i + 1] > x[i]) {
          int t = x[i + 1];
          x[i + 1] = y[i + 1];
          y[i + 1] = t;
        } else
          c++;
      }
    }
    if (c > 0)
      cout << "Impossible" << endl;
    else {
      for (i = 0; i < l - 1; i++) {
        if (y[i + 1] <= y[i]) {
          if (x[i + 1] > y[i] && y[i + 1] > x[i]) {
            int t = x[i + 1];
            x[i + 1] = y[i + 1];
            y[i + 1] = t;
          } else
            c++;
        }
      }
      if (c > 0) cout << "Impossible" << endl;
    }
    if (c == 0) cout << "Possible" << endl;
  } else {
    int a[n][m], b[n][m];
    for (i = 0; i < n; i++) {
      for (j = 0; j < m; j++) cin >> a[i][j];
    }
    for (i = 0; i < n; i++) {
      for (j = 0; j < m; j++) cin >> b[i][j];
    }
    if (a[0][0] >= a[1][0] && a[0][0] >= a[0][1]) {
      if (b[0][0] < a[1][0] && a[0][0] < a[0][1]) {
        int t = a[0][0];
        a[0][0] = b[0][0];
        b[0][0] = t;
        f = 1;
      }
    }
    for (i = 0; i < n; i++) {
      for (j = 0; j < m; j++) {
        if (j != m - 1) {
          if (a[i][j + 1] <= a[i][j]) {
            if (b[i][j + 1] > a[i][j]) {
              int t = a[i][j + 1];
              a[i][j + 1] = b[i][j + 1];
              b[i][j + 1] = t;
            } else
              k++;
          }
        }
        if (i != n - 1) {
          if (a[i + 1][j] <= a[i][j]) {
            if (b[i + 1][j] > a[i][j]) {
              int t = a[i + 1][j];
              a[i + 1][j] = b[i + 1][j];
              b[i + 1][j] = t;
            } else
              k++;
          }
        }
      }
    }
    if (k > 0)
      cout << "Impossible" << endl;
    else {
      if (b[0][0] >= b[1][0] && b[0][0] >= b[0][1]) {
        if (a[0][0] < b[1][0] && a[0][0] < b[0][1] && b[0][0] < a[1][0] &&
            b[0][0] < a[0][1]) {
          int t = b[0][0];
          b[0][0] = a[0][0];
          a[0][0] = t;
        } else
          k1++;
      }
      for (i = 0; i < n; i++) {
        for (j = 0; j < m; j++) {
          if (j != m - 1) {
            if (b[i][j + 1] <= b[i][j]) {
              if (a[i][j + 1] > b[i][j]) {
                if (b[i][j + 1] > a[i][j]) {
                  int t = a[i][j + 1];
                  a[i][j + 1] = b[i][j + 1];
                  b[i][j + 1] = t;
                } else
                  k1++;
              } else
                k1++;
            }
          }
          if (i != n - 1) {
            if (b[i + 1][j] <= b[i][j]) {
              if (a[i + 1][j] > b[i][j]) {
                if (b[i + 1][j] > a[i][j]) {
                  int t = a[i + 1][j];
                  a[i + 1][j] = b[i + 1][j];
                  b[i + 1][j] = t;
                } else
                  k1++;
              } else
                k1++;
            }
          }
        }
      }
      if (k1 > 0) cout << "Impossible" << endl;
    }
    if (k == 0 && k1 == 0) cout << "Possible" << endl;
  }
}
