N = [int(_) for _ in input().split()]



if 1 in N and 9 in N and 7 in N and 4 in N:

    print("YES")

else:

    print("NO")
N = [int(_) for _ in input().split()]



N.sort()

if N == [1, 4, 7, 9]:

    print("YES")

else:

    print("NO")

N = [int(_) for _ in input().split()]
if 1 in N and 9 in N and 7 in N and 4 in N:
    print("YES")
else:
    print("NO")

N = [int(_) for _ in input().split()]
N.sort()
if N == [1, 4, 7, 9]:
    print("YES")
else:
    print("NO")

-if 1 in N and 9 in N and 7 in N and 4 in N: +N.sort() +if N == [1, 4, 7, 9]: