object Main extends App {
	val NM = scala.io.StdIn.readLine.split(" ").map(_.toInt)

	var a = List[Int]()
	var b = List[Int]()

	for(i<-0 until NM(1)){
		val t = scala.io.StdIn.readLine.split(" ").map(_.toInt)
		if(t(0) == 1) a = t(1)::a
		if(t(1) == NM(0)) b = t(0)::b
	}

	if(a==b) println("POSSIBLE")
	else println("IMPOSSIBLE")

}
