import collection.mutable

object Main {
  def main(args: Array[String]): Unit = {
    val Array(n, m) = io.StdIn.readLine.split(" ").map(_.toInt)
    val graph: mutable.Map[Int, mutable.Set[Int]] = mutable.Map.empty.withDefaultValue(mutable.Set.empty)
    (1 to m).foreach { _ =>
      val Array(a, b) = io.StdIn.readLine.split(" ").map(n => n.toInt)
      graph.getOrElseUpdate(a, mutable.Set.empty) += b
    }
    val originEdges = graph.getOrElse(1, mutable.Set.empty)
    if (graph(1).exists(b => graph(b)(n))) {
      println("POSSIBLE")
    } else {
      println("IMPOSSIBLE")
    }
  }
}
