import java.util.HashSet

fun main(args: Array<String>) {
    val (n, m) = readLine()!!.split(' ').map(String::toInt)
    val transit = HashSet<Int>()
    repeat(m) {
        val (a, b) = readLine()!!.split(' ').map(String::toInt)
        if (a == 1) {
            if (transit.contains(b)) {
                println("POSSIBLE")
                return
            }
            transit.add(b)
        } else if (b == n) {
            if (transit.contains(a)) {
                println("POSSIBLE")
                return
            }
            transit.add(a)
        }
    }
    println("IMPOSSIBLE")
}
