integer N,M,A,B
integer,allocatable,dimension(:)::ISLAND
read*,N,M
allocate(ISLAND(N))
ISLAND=0
do i=1,M
  read*,A,B
  if(B==1.or.B==N)then
    A=xor(A,B)
    B=xor(A,B)
    A=xor(A,B)
  endif
  if(A==1.or.A==N)then
    ISLAND(B)=ISLAND(B)+1
    if(ISLAND(B)==2)then
      print"(A)","POSSIBLE"
      STOP
    endif
  endif
end do
print"(A)","IMPOSSIBLE"
end