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

print(('YES' if List.count(7)==1 and List.count(5)==2 else 'NO'))
l=list(input().split()) 

print(('YES' if l.count('5')==2 and l.count('7')==1 else 'NO'))
List = list(map(int, input().split()))
print(("YES" if List.count(7) == 1 and List.count(5) == 2 else "NO"))

l = list(input().split())
print(("YES" if l.count("5") == 2 and l.count("7") == 1 else "NO"))

-List = list(map(int, input().split())) -print(("YES" if List.count(7) == 1 and List.count(5) == 2 else "NO")) +l = list(input().split()) +print(("YES" if l.count("5") == 2 and l.count("7") == 1 else "NO"))