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