peterverebics/CodeNet_Python_118 huggingface dataset:
a=list(map(int,input().split()))

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

list_a = list(a)
list_a.sort()
if list_a == [5, 5, 7]:
  print("YES")
else:
  print("NO")
arr = list(map(lambda x: int(x), input().split(" ")))

if arr.count(5) == 2 and arr.count(7) == 1:
    print("YES")
else:
    print("NO")
print('YNEOS'[''.join(sorted(input()))!='  557'::2])
A = sorted(list(map(int, input().split())))
print('YES' if A[0] == 5 and A[1] == 5 and A[2] == 7 else 'NO')
a,b,c = map(int,input().split())
abclist = [a,b,c]
if abclist.count(5) == 2:
  print("YES")
else:
  print("NO")
a=list(map(int,input().split()))
if a.count(5)==2 and a.count(7)==1:
    print("YES")
else:
    print("NO")
a, b, c = map(int, input().split())

if a+b+c == 17:
  print('YES')
else:
  print('NO')
# -*- coding: utf-8 -*-
"""
Created on Wed May 13 11:57:51 2020

@author: shinba
"""

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

B = [[5,5,7],[5,7,5],[7,5,5]]

if A in B:
    print("YES")
else:
    print("NO")
a = input('')
if a.count('5') == 2 and a.count('7') ==1:
	print('YES')
else:
	print('NO')
ABC = list(map(int, input().split()))
if ABC.count(5) == 2 and ABC.count(7):
    print('YES')
else:
    print('NO')
# coding: utf-8
# Your code here!

l = input()
if l.count("5") == 2 and l.count("7") == 1:
    print("YES")
else:
    print("NO")
ABC=list(map(int,input().split()))
print("YES" if ABC.count(5)==2 and ABC.count(7)==1 else "NO")
list = input().split()
list.sort()
if ''.join(list) == '557':
  print('YES')
else:
  print('NO')
abc = list(map(int,input().split()))
print("YES" if sum(abc) == 17 and abc.count(5) else "NO")
length = list(map(int, input().split()))
judge = {0:5,1:7,2:5}

for i in range(len(judge)):
    for j in range(len(length)):
        if length[j] == judge[i]:
            length.pop(j)
            break
        else:
            if j == len(length)-1:
                print('NO')
                exit()
print('YES')
lis = list(map(int, input().split()))
lis.sort()

if lis[0] == 5 and lis[1]==5 and lis[2]== 7:
    print('YES')
else:
    print('NO')
n=input().split()
print("YES" if n.count("5")==2 and n.count("7")==1 else "NO")
a = list(map(int, input().split()))

if a.count(5) == 2 and a.count(7) == 1:
  print('YES')
else:
  print('NO')
#ABC042A
x = list(input().split())
print("YES" if x.count("5")==2 and x.count("7")==1 else "NO")
a,b,c=map(int, input().split())
t=0
if a==5:
  if b==5:
    if c==7:
      t=1
  elif b==7:
    if c==5:
      t=1
elif a==7:
  if b==5:
    if c==5:
      t=1
if t==1:
  print('YES')
else:
  print('NO')
a,b,c = map(int,input().split())
print("YES" if a*b*c ==175 else "NO")
A,B,C = map(int, input().split())

list_iroha = [A,B,C]

#print(list_iroha)
if [5,7,5] == list_iroha or [7,5,5] == list_iroha or [5,5,7] == list_iroha:
  print("YES")
else:
  print("NO")
a,b,c=map(int,input().split())
n=[a,b,c]
m=len([i for i in n if i==5])
p=len([i for i in n if i==7])
if m==2 and p==1:
  print('YES')
else:
  print('NO')
l = list(map(int, input().split()))
l.sort()
if l == [5,5,7]:
    print("YES")
else:
    print("NO")
a=list(map(int, input().split()))
if a.count(5)==2 and a.count(7)==1:
    print("YES")
else:
    print("NO")
a = list(map(int,input().split()))
a.sort()
if a[0]==5 and a[1]==5 and a[2]==7:
    print('YES')
else:
    print('NO')
s= input()
s = s.split()
s.sort()
if s == ["5","5","7"]:
  print("YES")
else:
  print("NO")
X=list(map(int,input().split()))
X.sort()
if X==[5,5,7]:
  print('YES')
else:
  print('NO')
a,b,c=map(int,input().split())
if a+b+c==17 and a*b*c==175:
    print("YES")
else:
    print("NO")
import sys
import math
import bisect

def main():
    A = list(map(int, input().split()))
    A.sort()
    if len(A) == 3 and A == [5, 5, 7]:
        print('YES')
    else:
        print('NO')

if __name__ == "__main__":
    main()
input_line = input().split()

if int(input_line[0]) + int(input_line[1]) + int(input_line[2]) != 17:
    print("NO")
    pass
elif input_line[0] == input_line[1] == "5":
    print("YES")
    pass
elif input_line[1] == input_line[2] == "5":
    print("YES")
    pass
elif input_line[0] == input_line[2] == "5":
    print("YES")
    
else:
    print("NO")
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    l=list(map(int,input().split()))
    l.sort()
    YESNO(l[0]==l[1]==5 and l[2]==7)

if __name__ == '__main__':
    main()
# 整数の入力
a, b, c = map(int, input().split())
# 合計17でないときNOを出力
if not (a+b+c == 17):
    print("NO")
    exit()
# 7を含まないときNOを出力
if not 7 in (a, b, c):
    print("NO")
    exit()
# 5を含まないときNOを出力、それ以外はYESを出力
if not 5 in (a, b, c):
    print("NO")
    exit()
else:
    print("YES")
a = input().split()
sums = 0
for i in a:
    sums += int(i)

if sums == 17:
    print("YES")
else:
    print("NO")
lima = 0
tujuh = 0
a = [int(tmp) for  tmp in input().split()]
for i in range(3) :
  if a[i] == 5 :
    lima += 1
  elif a[i] == 7 :
    tujuh += 1
if lima==2 and tujuh == 1 :
  print("YES")
else :
  print('NO')
nums = list(map(int, input().split()))
fives = nums.count(5)
sevens = nums.count(7)
print("YES") if (fives == 2 and sevens == 1) else print("NO")
str = input()
if str.count('5') == 2 and str.count('7') == 1:
  print('YES')
else:
  print('NO')
text = list(map(int, input().split()))
text.sort()
if text[0] == 5 and text[1] == 5 and text[2] == 7:
  print('YES')
else:
  print('NO')
A = list(map(int, input().split()))

A.sort()
if A[0] == 5:
    if A[1] == 5:
        if A[2] == 7:
            print("YES")
            exit()
print("NO")
seq = [int(s) for s in input().split()]
if seq.count(5) == 2 and seq.count(7) == 1:
	print("YES")
else: print("NO")
a,b,c = map(int,input().split())
A = [a,b,c]
B = [a,b,c]
A = A.count(5)
B = B.count(7)
if A == 2 and B == 1:
  print("YES")
else:
  print("NO")
if sorted(list(map(int,input().split())))==[5,5,7]:
  print('YES')
else:
  print('NO')
input_line=input()
if input_line.count("5")==2 and input_line.count("7")==1:
    print ("YES")
else:
    print ("NO")
l = [int(x) for x in input().split(' ')]

if (5 not in l):
  print('NO')

if (7 not in l):
  print('NO')

if (sum(l) == 17):
  print('YES')
else:
  print('NO')
a = list(input().split())
if a.count('7') == 1 and a.count('5') == 2:
  print('YES')
else:
  print('NO')
text = str(input())
cnt = 0

for i in text:
    if i == "5":
        cnt += 1
    if i == "7":
        cnt += 2

if cnt == 4:
    print("YES")
else:
    print("NO")
from collections import defaultdict
d = defaultdict(int)
A, B, C = map(int, input().split())
d[A] += 1
d[B] += 1
d[C] += 1
if d[5] == 2 and d[7] == 1:
    print('YES')
else:
    print('NO')
# -*- coding: utf-8 -*-

if __name__ == "__main__":
    # str_list = [map(int, input().split())]
    # if str_list.count(5) == 2 and str_list.count(7) == 1:
    #     print('YES')
    # else:
    #     print('NO')
    str_list = list(map(int, input().split()))
    if sum(str_list) == 17:
        print('YES')
    else:
        print('NO')
num = list(map(int,input().split()))
a=0
b=0
for i in range(3):
	if num[i]==5:
		a+=1
	if num[i]==7:
		b+=1
if a==2 and b==1:
	print("YES")
else:
	print("NO")
a = list(map(int, input().split()))
a.sort()

if a[0] == 5 and a[1] == 5 and a[2] == 7:
  print("YES")
else:
  print("NO")
l = list(map(int, input().split()))
l.sort(reverse=True)
if l[0] == 7 and l[1] == 5 and l[2] == 5:
  print('YES')
else:
  print('NO')
def resolve():
	x, y, z = map(int, input().split())
	if x + y + z == 17:
		print("YES")
	else:
		print("NO")

resolve()
s = list(map(int, input().split()))
tar = [5,7,5]
for a in s:
    for b in tar:
        if a == b:
            tar.remove(b)
            break
if tar == []:
    print("YES")
else:
    print("NO")
num = input().split(' ')
if num == ['5','7','5'] or num == ['7','5','5'] or num == ['5','5','7']:
    print('YES')
else:
    print('NO')
a, b, c = map(int, input().split())
if a == 5 and b == 5 and c == 7:
  print("YES")
elif a == 5 and b == 7 and c == 5:
  print("YES")
elif a == 7 and b == 5 and c == 5:
  print("YES")
else:
  print("NO")
a = input().split()
five = 0
seven = 0
for i in a:
    if i == "5":
        five += 1
    elif i == "7":
        seven += 1
if five == 2 and seven == 1:
    print("YES")
else:
    print("NO")
a=list((input()))
print('YES' if a.count(('5'))==2 and a.count(('7'))==1 else 'NO')
huga = list(map(int, input().split()))
huga.sort()
if huga[0] == 5 and huga[1] == 5 and huga[2] == 7:
  print('YES')
else:
  print('NO')
import sys
a = list(map(int,input().split()))
seven = a.count(7)
five = a.count(5)
if five==2 and seven==1:
    print("YES")
else:
    print("NO")
As=input().split()

count5=0
count7=0

for A in As:
    if A=="5":
        count5+=1
    elif A=="7":
        count7+=1

if count5==2 and count7==1:
    print("YES")
else:
    print("NO")
A = list(map(int, input().split()))
A.sort()
if A == [5,5,7]:
  print("YES")
else:
  print("NO")
ABC=input().split()

five_count=ABC.count("5")
seven_count=ABC.count("7")

if five_count == 2 and seven_count == 1:
  print("YES")
else:
  print("NO")
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    x = list(map(int, input().split()))
    if x.count(5) == 2 and x.count(7) == 1:
        print("YES")
    else:
        print("NO")
    
if __name__ == '__main__':
    main()
from sys import stdin, stdout
from time import perf_counter

import sys
sys.setrecursionlimit(10**9)
mod = 10**9+7

# import sys
# sys.stdout = open("e:/cp/output.txt","w")
# sys.stdin = open("e:/cp/input.txt","r")
l=sorted(map(int,input().split()))
print("YES" if l == [5,5,7] else "NO")
nums = list(input().split())

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

five = 0
seven = 0

for i in l:
  if i == 5:
    five += 1
  elif i == 7:
    seven += 1
if five ==2 and seven ==1:
  print("YES")
else:
  print("NO")
def actual(A, B, C):
    if (A, B, C) in [(5, 5, 7), (5, 7, 5), (7, 5, 5)]:
        return 'YES'

    return 'NO'

A, B, C = map(int, input().split())  
print(actual(A, B, C))
S=input();print('NYOE S'[S.count('5')==2 and S.count('7')==1::2])
print('YNEOS'[eval(input().replace(*' *'))!=175::2])
from collections import Counter
ns = Counter([int(i) for i in input().split()])
if ns[5] == 2 and ns[7] == 1:
    print("YES")
else:
    print("NO")
a = sorted(list(map(int, input().split())))
print("YES" if a == [5,5,7] else "NO")
import sys
input = sys.stdin.readline

a,b,c = sorted(list(map(int,input().split())))
print('YES' if a==b and b==5 and c==7 else 'NO')
A,B,C = map(int,input().split())
count7 = 0
count5 = 0

ans = [A,B,C]

for i in ans:
    if i == 7:
        count7 += 1
    elif i == 5:
        count5 += 1

if count7 == 1 and count5 == 2:
    print('YES')
else:
    print('NO')
A, B, C = map(int, input().split())

count_5 = 0
count_7 = 0

if A == 5:
  count_5 += 1
elif A == 7:
  count_7 += 1
  
if B == 5:
  count_5 += 1
elif B == 7:
  count_7 += 1
  
if C == 5:
  count_5 += 1
elif C == 7:
  count_7 += 1
  
if count_5 == 2 and count_7 == 1:
  print("YES")
else:
  print("NO")
A = list(input())
print("YES" if A.count("5")==2 and A.count("7")==1 else "NO")
a, b, c = input().split()

flag = bool

if a == '5' and b =='7' and c=='5':
    flag = True
if a =='7' and b=='5' and c == '5':
    flag = True
if a =='5' and b=='5' and c == '7':
    flag = True

if flag == True:
    print('YES')
else:
    print('NO')
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    A, B, C = LI()

    if (A, B, C).count(5) == 2 and (A, B, C).count(7) == 1:
        print('YES')
    else:
        print('NO')

if __name__ == '__main__':
    resolve()
A,B,C = map(int, input().split())

list = sorted([A,B,C])

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

if a+b+c == 17 and (5 in [a,b,c] and 7 in [a,b,c]):
    print("YES")
else:
    print("NO")
n_5 = 0
n_7 = 0

a = map(int, input().split())
for i in a:
    if i == 5:
        n_5 += 1
    elif i == 7:
        n_7 += 1

if n_5 == 2 and n_7 == 1:
    print("YES")
else:
    print("NO")
x = 1
for a in input().split():
  x *= int(a)
if x == 175:
  print('YES')
else:
  print('NO')
a,b,c=sorted(input().split())
print(["NO","YES"][a==b=="5" and c=="7"])
li=list(map(int,input().split()))
ans = 'YES' if (li.count(5) == 2) and (li.count(7) == 1) else "NO"
print(ans)
arr = list(map(int, input().split()))
if arr.count(5) == 2 and arr.count(7):
    print("YES")
else:
    print('NO')
s = input().split()
fiveCNT = 0
sevenCNT = 0
if s[0] == '5':
    fiveCNT = fiveCNT + 1
elif s[0] == '7':
    sevenCNT = sevenCNT + 1
if s[1] == '5':
    fiveCNT = fiveCNT + 1
elif s[1] == '7':
    sevenCNT = sevenCNT + 1
if s[2] == '5':
    fiveCNT = fiveCNT + 1
elif s[2] == '7':
    sevenCNT = sevenCNT + 1
if fiveCNT == 2 and sevenCNT == 1:
    print('YES')
else:
    print('NO')
x = list(map(int, input().split()))
x.sort()
f = True
for i, e in enumerate(x):
    tmp = 5
    if i == 2:
        tmp = 7

    f &= (tmp == e)
print("YES" if f else "NO")
a = list(map(int, input().split()))
a.sort()
if a == [5, 5, 7]:
    print("YES")
else:
    print("NO")
A = list(map(int, input().split()))

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

five=a.count(5)
seven=a.count(7)

if five==2 and seven==1:
  print('YES')
else:
  print('NO')
# -*- coding: utf-8 -*-
# 整数の入力
a, b, c = map(int, input().split())
# カウンタのクリア
five_count = 0
seven_count = 0
# 5,7,5を判定
def setsu_check(x):
	global five_count, seven_count
	if x == 5:
		five_count+=1
	elif x == 7:
		seven_count+=1
# 判定関数のCALL
setsu_check(a)
setsu_check(b)
setsu_check(c)
if five_count == 2 and seven_count == 1:
	print("YES")
else:
	print("NO")
a = list(map(int,input().split()))
if a.count(5) == 2 and a.count(7) == 1:
  print("YES")
else:
  print("NO")
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
A, B, C = map(int, input().split())
# 文字列の入力
#s = input()
#print(s[0:K-1]+s[K-1].lower()+s[K:N])
if A*B*C == 5*5*7:
    print("YES")
else:
    print("NO")
l = list(map(int, input().split()))
count = count2 = 0
for i in range(3):
  if(l[i] == 5):
    count+=1
  elif(l[i] == 7):
    count2 += 1
    
if(count == 2 and count2 == 1):
    print("YES")
else:
	print("NO")
a,b,c=map(int,input().split())
if(a==5):
    if(b==7 and c==5):
        print("YES")
    elif(b==5 and c==7):
        print("YES")
    else:
        print("NO")
elif(a==7):
    if(b==5 and c==5):
        print("YES")
    else:
        print("NO")
else:
    print("NO")
l = list(map(int, input().split()))
count_5 = 0
count_7 = 0
for r in l:
  if r == 5:
    count_5 += 1
  if r == 7:
    count_7 += 1
if count_5 == 2 and count_7 == 1:
  print('YES')
else:
  print('NO')
a, b, c = map(int, input().split())
s = str(a) + str(b) + str(c)
if s == "557":
  print("YES")
elif s == "575":
  print("YES")
elif s == "755":
  print("YES")
else:
  print("NO")
a, b, c = map(int, input().split())
if a==5 or 7 and b==5 or 7 and c==5 or 7:
    if a+b+c == 17:
        print("YES")
    else:
        print("NO")
else:
    print("NO")
A = list(map(int, input().split()))

A_sort = sorted(A)

if A_sort[0]==5 and A_sort[1]==5 and A_sort[2]==7:
    print("YES")
else:
    print("NO")
a,b,c=map(int,input().split())
if (a+b+c==17):
  print('YES')
else:
  print('NO')
li = list(map(int, input().rstrip().split()))
five = 0
seven = 0
for x in li:
    if x == 5:
        five += 1
    elif x == 7:
        seven += 1
if five == 2 and seven == 1:
    print("YES")
else:
    print("NO")
a, b, c = map(int, input().split())

count_5 = 0
count_7 = 0

if a == 5:
    count_5 += 1
elif a == 7:
    count_7 += 1

if b == 5:
    count_5 += 1
elif b == 7:
    count_7 += 1

if c == 5:
    count_5 += 1
elif c == 7:
    count_7 += 1

if count_5 == 2 and count_7 == 1:
    print("YES")
else:
    print("NO")
s  = input().split()
s.sort()
if s[0] == '5' and s[1] == '5' and s[2] == '7':
    print('YES')
else:
    print('NO')
A,B,C = map(int,input().split())
res = "NO"
if A == 5 or A == 7:
  if B == 5 or B == 7:
    if C == 5 or C == 7:
      if A+B+C == 17:
        res = "YES"
print(res)
a,b,c=(int(x) for x in input().split())
if a==b==5 and c==7:
    print('YES')
elif b==c==5 and a==7:
    print('YES')
elif c==a==5 and b==7:
    print('YES')
else:
    print('NO')
a = input()
A = int(a[0])
B = int(a[2])
C = int(a[4])

if(A==5 and B==7 and C==5):
    print('YES')
elif(A==7 and B==5 and C==5):
    print('YES')
elif(A==5 and B==5 and C==7):
    print('YES')
else:
    print('NO')
T = [int(_) for _ in input().split()]

x = sorted(T)
if x[0] == 5 and x[1] == 5 and x[2] == 7:
    print("YES")
else:
    print("NO")
tupni = [int(idx) for idx in input().split(" ")]
tupni.sort()
if tupni == [5,5,7]:
  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,b,c=map(int,input().split())
d=[a,b,c]
if d.count(5)==2 and d.count(7)==1:
    print("YES")
else:
    print("NO")
a,b,c=map(int,input().split());print(['NO','YES'][max(a,b,c)==7 and (a+b+c)-max(a,b,c)==10])
i=input()
if i=="5 7 5" or i=="7 5 5" or i=="5 5 7":
  print("YES")
else:
  print("NO")
s = input()
if s.count('5') == 2 and s.count('7') == 1:
  print('YES')
else:
  print('NO')
abc = input().split()
d = abc[0]
e = abc[1]
f = abc[2]
g = d + e + f
g = int(g)
a = 575
b = 557
c = 755

if g == a:
    print("YES")
elif g == b:
    print("YES")
elif g == c:
    print("YES")
else:
    print("NO")
S = input()
if S.count("5") == 2 and S.count("7") == 1 :
  print("YES")
else :
  print("NO")
l = sorted(list(map(int,input().split())))
ans = [5,5,7]
print("YES" if l == ans else "NO")
length = list(map(int, input().split()))

length.sort()

if length == [5,5,7]:
    print('YES')
else:
    print('NO')
a,b,c = map(int,input().split())
if a == b == 5 and c== 7:
  print("YES")
elif a == c == 5 and b== 7:
  print("YES")
elif c == b == 5 and a== 7:
  print("YES")
else:
  print("NO")
X = list(map(int,input().split()))
X.sort()
print('YES' if X==[5,5,7] else 'NO')
ABC = input().split()
print("YES" if ABC.count("5") == 2 and ABC.count("7") == 1 else "NO")
num=list(map(int,input().split()))
num.sort()
print('YES' if num==[5,5,7] else 'NO')
abc = list(map(int,input().split()))

if 5 in abc and 7 in abc and abc.count(7)==1:
  print('YES')
else:
  print('NO')
from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations

def main():
    A = list(map(int, input().split()))

    print('YES') if A.count(5) == 2 and A.count(7) == 1 else print('NO')

if __name__ == '__main__':
    main()
a,b,c=sorted(map(int,input().split()))
print(["NO","YES"][a==b==5 and c==7])
a,b,c=(map(int,input().split()))
if a==5:
  if b==5:
    if c==7:
      print("YES")
    else:
      print("NO")
  elif b==7:
    if c==5:
      print("YES")
    else:
      print("NO")
  else:
    print("NO")
elif a==7:
  if b==5 and c==5:
    print("YES")
  else:
    print("NO")
else:
  print("NO")
import sys
def input(): return sys.stdin.readline().strip()

def main():
    a, b, c = map(int, input().split())
    if a == 5 and b == 5 and c == 7:
        print("YES")
        return
    if b == 5 and c == 5 and a == 7:
        print("YES")
        return
    if c == 5 and a == 5 and b == 7:
        print("YES")
        return
    print("NO")


if __name__ == "__main__":
    main()
l = list(map(int,input().split()))
go = 0
shichi = 0
for i in range(3):
  if l[i] == 5:
    go += 1
for i in range(3):
  if l[i] == 7:
    shichi += 1
if go == 2 and shichi ==1:
  print('YES')
else:
  print('NO')
a, b, c = map(int, input().split())
abc = sorted([a, b, c])
if abc[0] == 5 and abc[1] == 5 and abc[2] == 7:
    print('YES')
else:
    print('NO')
a = [int(x) for x in input().split()]

if a.count(5) == 2 and a.count(7) == 1:
    print("YES")
else:
    print("NO")
icase=42

if icase==42:
    a=list(map(int,input().split()))
    a.sort()
    if a[0]==5 and a[1]==5 and a[2]==7:
        print("YES")
    else:
        print("NO")
A=list(map(int,input().split()))
A.sort()
#print(A)
if A==[5,5,7]:
  print('YES')
else:
  print('NO')
t = list(map(int,input().split()))

if t.count(5)==2 and t.count(7)==1:
  print('YES')
else:
  print('NO')
a = list(map(int,input().split()))
if (a.count(5) == 2) and (a.count(7) == 1):
  print("YES")
else:
  print("NO")
L = sorted(map(int, input().split()))
 
ans = 'YES' if L == [5, 5, 7] else 'NO'
print(ans)
l=list(map(int,input().split()))
print('YES'if l.count(5)==2 and l.count(7)==1 else'NO')
class A:

    def solve(self):
        [a, b, c] = sorted([int(x) for x in input().split(" ")])
        if a == 5 and b == 5 and c == 7:
            print("YES")
        else:
            print("NO")

A().solve()
def prod(ls):
    def resolve(ls, a):
        if len(ls) == 1:
            return a*ls[0]
        else:
            car = ls[0]
            ls = ls[1:]
            return resolve(ls, a*car)
    return resolve(ls, 1)

ls = list(map(int, input().split()))
if sum(ls) == 17 and prod(ls) == 175:
    print("YES")
else :
    print("NO")
a, b, c = map(int,input().split())
d = [a, b, c]
if d.count(5) == 2 and d.count(7) == 1:
    print("YES")
    
else:
    print("NO")
li = list(map(int,input().split()))
if sum(li) != 17 or max(li) != 7 or min(li) != 5:
  print("NO")
  exit()
print("YES")
input_line = list(map(int, input().split()))
input_line.sort()

print("YES" if input_line == [5, 5, 7] else "NO")
input_line = input().split()
if input_line.count("5") == 2 and input_line.count("7") == 1:
	print("YES")
else:
	print("NO")
a,b,c=map(int,input().split())
d=0
if a==5 or b==5 or c==5:
  if a==7 or b==7 or c==7:
    if a+b+c==17:
      print("YES")
      d=1
if d==0:
  print("NO")
arr = list(map(int, input().split()))
arr.sort()
if (arr[0] == 5) and (arr[1] == 5) and (arr[2] == 7):
    print("YES")
else:
    print("NO")
print(['YES','NO'][sum(list(map(int,input().split()))) != 17])
a=list(map(int,input().split()))
a.sort()
if a[0]==5 and a[1]==5 and a[2]==7:print("YES")
else:print("NO")
if __name__ == '__main__':
  haiku = input()
  if haiku.count('5') == 2 and haiku.count('7') == 1:
    print('YES')
  else:
    print('NO')
A = list(map(int, input().split()))

A.sort()

if A == [5, 5, 7]:
  print("YES")
else:
  print("NO")
a=sorted(list(map(int,input().split())))
print("YES" if a == [5,5,7] else "NO")
a = list(map(int,input().split()))
a.sort()
if a[0] == a[1] == 5 and a[2] == 7:
    print("YES")
else:
    print("NO")
a,b,c = sorted(map(int, input().split()))
if (a+b+c==17)&(a==b)&(c==7):
  print("YES")
else:
  print("NO")
S = list(map(int, input().split()))

if S.count(5) == 2 and S.count(7):
  print("YES")
else:
  print("NO")
A = list(map(int, input().split()))
if A.count(5) == 2 and A.count(7) == 1:
    print('YES')
else:
    print('NO')
a = list(map(int,input().split()))
if(sum(a) == 17 and 7 in a):
    print("YES")
else:
    print("NO")
abc = list(map(int,input().split()))

if abc == [5,5,7]:
    print('YES')
    exit()
if abc == [7,5,5]:
    print('YES')
    exit()
if abc == [5,7,5]:
    print('YES')
    exit()
print('NO')
a=list(map(int,input().split()))
if a.count(7)==1 and a.count(5)==2:
    print("YES")
else:
    print("NO")
S=input();print('YES' if S.count('7')==1 and S.count('5')==2 else 'NO')
l=sorted(list(map(int,input().split())))
print("YES" if l[0]==l[1]==5 and l[2]==7 else "NO")
s=input().split()
print("YES" if s.count("5")==2 and s.count("7")==1 else "NO")
sets = sorted(list(map(int, input().split())))
print('YES' if sets == [5, 5, 7] else 'NO')