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

fun abc068c() {
    val (n, m) = readLine()!!.split(' ').map { it.toInt() }
    val abList = (1..m).map { readLine()!!.split(' ').map { it.toInt() } }
        .map { Pair(it[0], it[1]) }

    val from1 = abList.filter { it.first == 1 }.map { it.second }
    val toN = abList.filter { it.second == n }.map { it.first }

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

    println(answer)
}
