import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)

  val n = sc.nextInt
  val m = sc.nextInt

  val abl = Vector.fill(m)((sc.nextInt, sc.nextInt))

  val from1 = abl.filter(_._1 == 1).map(_._2)
  val toN   = abl.filter(_._2 == n).map(_._1)

  val res = if(from1.intersect(toN).nonEmpty) "POSSIBLE" else "IMPOSSIBLE"

  println(res)
}