phrases = [ int(i) for i in input().split() ]

if phrases.count(5) == 2 and 5 in phrases:

	print("YES")

else:

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

if phrases.count(5) == 2 and 7 in phrases:

	print("YES")

else:

	print("NO")
phrases = [int(i) for i in input().split()]
if phrases.count(5) == 2 and 5 in phrases:
    print("YES")
else:
    print("NO")

phrases = [int(i) for i in input().split()]
if phrases.count(5) == 2 and 7 in phrases:
    print("YES")
else:
    print("NO")

-if phrases.count(5) == 2 and 5 in phrases: +if phrases.count(5) == 2 and 7 in phrases: