n,m=io.read("*n","*n")
c,d={},{}
for i=1,m do
	local a,b=io.read("*n","*n")
	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")