import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)

  val n1 = sc.nextInt
  val n2 = sc.nextInt
  val n3 = sc.nextInt
  val n4 = sc.nextInt

  val res = if(Set(n1,n2,n3,n4) == Set(1,9,7,4)) "YES" else "NO"

  println(res)
}