L = sorted(list(map(int, input().split())))

if L == [5,5,7]:

 print("YES")

else:

 print("NO")
S = [int(i) for i in input().split()]

S.sort()

if S == [5,5,7]:

	print("YES")

else:

	print("NO")

L = sorted(list(map(int, input().split())))
if L == [5, 5, 7]:
    print("YES")
else:
    print("NO")

S = [int(i) for i in input().split()]
S.sort()
if S == [5, 5, 7]:
    print("YES")
else:
    print("NO")

-L = sorted(list(map(int, input().split()))) -if L == [5, 5, 7]: +S = [int(i) for i in input().split()] +S.sort() +if S == [5, 5, 7]: