object Main extends App {
  val in = scala.io.Source.stdin.getLines
  val in2 = in.map(_.split(' ').map(_.toInt).toSeq).toSeq.head
  //println(in2)
  val s = in2.sorted
  val ret = if(s == Seq(1,4,7,9)) "YES" else "NO"
  println(ret)
}
