program abc068c
  implicit none
  integer n, m
  integer,allocatable :: ab(:,:)
  logical,allocatable :: x(:), y(:)

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

  x = .false.
  y = .false.

  read *, ab
  x(ab(2,:)) = merge(.true.,.false.,ab(1,:) == 1)
  y(ab(1,:)) = merge(.true.,.false.,ab(2,:) == n)

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