case class Node(id: Int) {
  var edges: Set[Node] = Set.empty
}

class Graph(val nodes: Set[Node])

object Main {
  def main(args: Array[String]): Unit = {
    val Array(n, m) = io.StdIn.readLine.split(" ").map(_.toInt)
    val nodes = (1 to n).map(v => Node(v)).toSet
    val graph = new Graph(nodes)
    (1 to m).foreach { _ =>
      val Array(a, b) = io.StdIn.readLine.split(" ").map(n => Node(n.toInt))
      graph.nodes.find(_ == a).foreach(_.edges += graph.nodes.find(_ == b).get)
    }
    val start = graph.nodes.find(_ == Node(1)).get
    val end = graph.nodes.find(_ == Node(n)).get
    if (start.edges.exists { n => n.edges(end) }) {
      println("POSSIBLE")
    } else {
      println("IMPOSSIBLE")
    }
  }
}
