import java.util.*

fun main(args : Array<String>) {
    val (n, m) = readLine()!!.split(" ").map { it.toInt() }
    val edges = Array<MutableSet<Int>>(n) { mutableSetOf() }

    repeat(m) {
        val (a, b) = readLine()!!.split(" ").map { it.toInt()-1 }
        edges[a].add(b)
        edges[b].add(a)
    }

    val bfs = ArrayDeque<Pair<Int, Int>>(n)
    bfs.addLast(Pair(0, 0))
    val seen = Array(n) {false}
    seen[0] = true

    while(bfs.isNotEmpty()) {
        val node = bfs.removeFirst()

        if (node.first == n-1) {
            println(if (node.second == 2) "POSSIBLE" else "IMPOSSIBLE")
            return
        }

        edges[node.first].forEach {
            if (!seen[it]) {
                seen[it] = true
                bfs.addLast(Pair(it, node.second+1))
            }
        }
    }

    println("IMPOSSIBLE")
}

