fun main(args: Array<String>) {
    val (n, m) = readLine()?.split(" ")?.map(Integer::parseInt) ?: return
    val shipMap = mutableMapOf<String, Int>()
    repeat(m) {
        val (a, b) = readLine()?.split(" ")?.map(Integer::parseInt)!!
        shipMap["${a}_${b}"] = 0
    }
    for (midIsland in 2..m) {
        if (shipMap.containsKey("1_$midIsland") && shipMap.containsKey("${midIsland}_$n")) {
            println("POSSIBLE")
            return
        }
    }
    println("IMPOSSIBLE")
}