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() - 1 } }
        .map { Pair(it[0], it[1]) }
    val paths = Array(n) { mutableSetOf<Int>() }

    abList.forEach {
        paths[it.first].add(it.second)
        paths[it.second].add(it.first)
    }

    var list = mutableSetOf(0)
    repeat(2) {
        val curr = list.map { paths[it] }.flatten().toSet()
        if (curr.contains(n - 1)) return println("POSSIBLE")
        list = curr.toMutableSet()
    }

    return println("IMPOSSIBLE")
}
