
local n,m=io.read("*n","*n")
local start={}
local goal={}
for i=1,m do
    local a,b=io.read("*n","*n")
    if a==1 then
        start[i]=b
    end
    if b==n then
        goal[a]=true
    end
end

for _,i in pairs(start) do
    if goal[i] then
        print("POSSIBLE")
        return
    end
end
print("IMPOSSIBLE")