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
	}

	def find(N: Int, M: Int, a: List[Int], b: List[Int]): Boolean = {
		for(i<-a){
			if(b.contains(i)) return true
		}
		return false
	}

	if(find(NM(0), NM(1), a, b)) println("POSSIBLE")
	else println("IMPOSSIBLE")

}
