import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val n = sc.nextInt()
  val m = sc.nextInt()
  val ab = (1..m).map { Pair(sc.nextInt(), sc.nextInt()) }

  val map = mutableMapOf<Int, MutableList<Int>>()
  for (abi in ab) {
    val a = abi.first
    val b = abi.second
    val tmp = map.getOrElse(a) { mutableListOf<Int>() }

    tmp.add(b)
    map.put(a, tmp)
  }

  val list = map.get(1)!!

  val list2 = mutableListOf<Int>()
  for (li in list) {
    if (!map.containsKey(li)) continue
    val tmp = map.get(li)!!
    list2.addAll(tmp)
  }


  var ok = false
  for (li in list2) {
    if (li == n) ok = true
  }


  if (ok) {
    println("POSSIBLE")
    return
  }
  println("IMPOSSIBLE")

}