x = eval(input())

mode = 0

count = 0

for num in x.split(" "):

  if num == '5':

    mode+=1

  elif num =='7':

    mode+=4

  count+=1



if mode == 6 and count == 3:

  print("YES")

else:

  print("NO")
x = eval(input())

str_a = x.split(" ")

array=[0]*10

for s in str_a:

  array[int(s)]+=1

if array[5]==2 and array[7]==1:

  print("YES")

else:

  print("NO")

x = eval(input())
mode = 0
count = 0
for num in x.split(" "):
    if num == "5":
        mode += 1
    elif num == "7":
        mode += 4
    count += 1
if mode == 6 and count == 3:
    print("YES")
else:
    print("NO")

x = eval(input())
str_a = x.split(" ")
array = [0] * 10
for s in str_a:
    array[int(s)] += 1
if array[5] == 2 and array[7] == 1:
    print("YES")
else:
    print("NO")

-mode = 0 -count = 0 -for num in x.split(" "): -    if num == "5": -        mode += 1 -    elif num == "7": -        mode += 4 -    count += 1 -if mode == 6 and count == 3: +str_a = x.split(" ") +array = [0] * 10 +for s in str_a: +    array[int(s)] += 1 +if array[5] == 2 and array[7] == 1: