S = eval(input())

print(('YES' if S.count('5') == 2 and S.count('7') == 1 else 'NO'))
print(('YES' if [5, 5, 7] == sorted(list(map(int, input().split()))) else 'NO'))



S = eval(input())
print(("YES" if S.count("5") == 2 and S.count("7") == 1 else "NO"))

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

-S = eval(input()) -print(("YES" if S.count("5") == 2 and S.count("7") == 1 else "NO")) +print(("YES" if [5, 5, 7] == sorted(list(map(int, input().split()))) else "NO"))