#include <bits/stdc++.h>
using namespace std;
const int SIZE = 200005;
int i, n, m, a, b;
int A[SIZE], B[SIZE], c[SIZE];
int main() {
  cin >> n >> m;
  for (i = 0; i < n; i++) {
    cin >> A[i] >> B[i];
  }
  for (i = 0; i < n; i++) {
    if (A[i] == 1) c[B[i]] = 1;
  }
  bool ans = false;
  for (i = 0; i < n; i++) {
    if (B[i] == n && c[A[i]] == 1) ans = true;
    if (ans) break;
  }
  if (!ans)
    cout << "IMPOSSIBLE";
  else
    cout << "POSSIBLE";
}
