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

	val a = new Array[Int](NM(1))
	val b = new Array[Int](NM(1))

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

	def find(N: Int, M: Int, a: Array[Int], b: Array[Int]): Boolean = {
		var x = List[Int]()
		var y = List[Int]()

		for(i<-0 until M){
			if(a(i) == 1) x = b(i)::x
			if(b(i) == N) y = a(i)::y
		}

		for(i <- x){
			if(y.contains(i)) return true
		}
		return false
	}

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

}