fun main(args: Array<String>) {
    val array0 = readLine()!!.split(" ").map { s -> s.toInt() }

    val list1974 = mutableListOf(1, 9, 7, 4)
    for (n in array0) {
        when (n) {
            1 -> list1974.remove(1)
            9 -> list1974.remove(9)
            7 -> list1974.remove(7)
            4 -> list1974.remove(4)
        }
    }
    if (list1974.size==0){
        print("YES")
    }else{
        print("NO")

    }

}