n = list(map(int, input().split()))



if 1 in n:

    if 9 in n:

        if 7 in n:

            if 4 in n:

                print("YES")

                exit()

print("NO")
n = set(map(int, input().split()))



if {1, 9, 7, 4} == n:

    print("YES")

else:

    print("NO")
n = list(map(int, input().split()))
if 1 in n:
    if 9 in n:
        if 7 in n:
            if 4 in n:
                print("YES")
                exit()
print("NO")

n = set(map(int, input().split()))
if {1, 9, 7, 4} == n:
    print("YES")
else:
    print("NO")

-n = list(map(int, input().split())) -if 1 in n: -    if 9 in n: -        if 7 in n: -            if 4 in n: -                print("YES") -                exit() -print("NO") +n = set(map(int, input().split())) +if {1, 9, 7, 4} == n: +    print("YES") +else: +    print("NO")