object Main {
  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)
    val n = Seq.fill(4)(sc.nextInt())
    println(
      if(n.sortBy(c => c) == Seq(1,4,7,9)) "YES" else "NO"
    )
  }
}