fun main(args: Array<String>) {
    abc068c()
}

fun abc068c() {
    val (n, m) = readLine()!!.split(' ').map { it.toInt() }
    val aList = IntArray(m)
    val bList = IntArray(m)
    (1..m).map { readLine()!!.split(' ').map { it.toInt() } }
        .forEachIndexed { index, list ->
            aList[index] = list[0]
            bList[index] = list[1]
        }

    val from1 = aList.withIndex().filter { it.value == 1 }.map { bList[it.index] }.toSet()
    val toN = bList.withIndex().filter { it.value == n }.map { aList[it.index] }.toSet()

    val answer = if ((from1 intersect toN).isNotEmpty()) "POSSIBLE" else "IMPOSSIBLE"

    println(answer)
}
