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

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

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

	def find(N: Int, M: Int, a: Array[(Int,Int)]): Boolean = {
		for(i<-0 until M){
			if(a(i)._1 == 1){
				for(j<-0 until M){
					if(a(j)._1 == a(i)._2 && a(j)._2 == N) return true
				}
			}
		}
		return false
	}

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