program abc068c
  implicit none
  integer n, m, a, b, i
  logical,allocatable :: x(:), y(:)

  read *, n,m
  allocate(x(n),y(n))

  x = .false.
  y = .false.

  do i = 1,m
     read *, a,b
     if (a == 1) x(b) = .true.
     if (b == n) y(a) = .true.
  end do

  if (count(x.and.y) > 0) then
     print *, 'POSSIBLE'
  else
     print *, 'IMPOSSIBLE'
  end if
end program abc068c
