n,m=io.read("*n","*n")
f=io.read("*a")
c,d={},{}
for a,b in f:gmatch("(%d+) (%d+)") do
	a=tonumber(a);b=tonumber(b)
	if a==1 then c[#c+1]=b end
	if b==n then d[a]=true end
end
for _,i in ipairs(c)do
	if d[i] then
		print("POSSIBLE")
		os.exit()
	end
end
print("IMPOSSIBLE")