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".
n = list(map(int,input().split()))
if "1" in n and "9" in n and "7" in n and "4" in n:
    print("YES")
else:
    print("NO")
n = list(map(int,input().split()))
if 1 in n and 9 in n and 7 in n and 4 in n:
    print("YES")
else:
    print("NO")
