A, B, C=list(map(int, input().split(" ")))

if ([A, B, C].count(5)==2) and ([A, B, C].count(7)==1):

  print('YES')

else:

  print('NO')

data=list(map(int, input().split(" ")))

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

  print('YES')

else:

  print('NO')
A, B, C = list(map(int, input().split(" ")))
if ([A, B, C].count(5) == 2) and ([A, B, C].count(7) == 1):
    print("YES")
else:
    print("NO")

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

-A, B, C = list(map(int, input().split(" "))) -if ([A, B, C].count(5) == 2) and ([A, B, C].count(7) == 1): +data = list(map(int, input().split(" "))) +if (data.count(5) == 2) and (data.count(7) == 1):