program main
	implicit none
	integer n,m,a(400000),c(200000)
	integer ::i,j=1,l
	logical ::k=.false.
	read(*,*)n,m
	do i=1,m
		read(*,*)a(2*i-1),a(2*i)
	enddo
	do i=1,m
		if(a(2*i-1)==1)then
			c(j)=a(2*i)
			j=j+1
		endif
	enddo
	do i=1,j-1
		do l=1,m
			if(a(2*l-1)==c(i).and.a(2*l)==n)k=.true.
		enddo
	enddo
	if(k)then
		write(*,'(a8)')"POSSIBLE"
	else
		write(*,'(a10)')"IMPOSSIBLE"
	endif
end program main
