a = eval(input())



if (a.count("5") == 2 and a.count("7") == 1):

  print("YES")

  

else:

  print("NO")
l=list(map(int,input().split()))

if l.count(5)==2 and l.count(7)==1:

  print('YES')

else:

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

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

-a = eval(input()) -if a.count("5") == 2 and a.count("7") == 1: +l = list(map(int, input().split())) +if l.count(5) == 2 and l.count(7) == 1: