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

for _,i in pairs(boat1) do
    if boat2[i][2]==n then
        print("POSSIBLE")
        return
    end
end
print("IMPOSSIBLE")