local n, m = io.read("*n", "*n")
local s, e = {}, {}
for i = 1, m do
  local a, b = io.read("*n", "*n")
  if(a == 1) then table.insert(s, b) end
  if(b == n) then e[a] = true end
end
local found = false
for k, v in pairs(s) do
  if(e[v]) then found = true break end
end
print(found and "POSSIBLE" or "IMPOSSIBLE")
