object Main extends App{
  val line = scala.io.StdIn.readLine()
  val Lengths = List(5, 7, 5)
  val haikuList = line.split(" ").map(_.toInt)
  println(isHaiku(haikuList, Lengths))

  def isHaiku(haiku: Array[Int],lengths: List[Int]): String =
    if (haiku.forall(s => lengths.contains(s)))"YES" else "NO"
}