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