You are given four digits N_1, N_2, N_3 and N_4. Determine if these can be arranged into the sequence of digits "1974".
a = [int(i) for i in input().split()] 

for i in [2, 5, 6, 7 ,8]:
    if i in a:
        print("No")
        break
    else:
        if i == 8:
            print("Yes")
a = [int(i) for i in input().split()] 
b = []
for i in a:
    if i in [2, 3, 5, 6, 8]:
        print("NO")
        break
    elif i in b:
        print("NO")
        break
    else:
        b.append(i)
        if len(b) == 4:
            print("YES")