import core.bitop;
import std.algorithm;
import std.array;
import std.ascii;
import std.container;
import std.conv;
import std.format;
import std.math;
import std.random;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

int n, m;
int[][] adj;
bool ok(int now, int depth)
{
  if (depth == 2) {
    return now == n;
  }
  bool flag = false;
  foreach (next; adj[now]) {
    flag |= ok(next, depth + 1);
  }
  return flag;
}

void main()
{
  auto nm = readln.chomp.split.map!(to!int);
  n = nm.front;
  m = nm.back;
  adj = new int[][](n + 1);
  foreach (i; 0..m) {
    auto ab = readln.chomp.split.map!(to!int);
    int a = ab.front;
    int b = ab.back;
    adj[a] ~= b;
    adj[b] ~= a;
  }
  writeln =  ok(1, 0) ? "POSSIBLE" : "IMPOSSIBLE";
}
