Iroha loves _Haiku_. Haiku is a short form of Japanese poetry. A Haiku consists of three phrases with 5, 7 and 5 syllables, in this order.  To create a Haiku, Iroha has come up with three different phrases. These phrases have A, B and C syllables, respectively. Determine whether she can construct a Haiku by using each of the phrases once, in some order.
num=input()
moji=num.split(" ")

if int(moji[0])==7 or int(moji[0])==5:
    pass
else:
    print("NO")
    
    if moji[1]==7 or moji[1]==5:
        if int(moji[0])+int(moji[1])+int(moji[2])==19:
            print("YES")
    else:
        print("NO")
num=input()
moji=num.split(" ")

if int(moji[0])==7 or int(moji[0])==5:
    pass
else:
    print("NO")

if int(moji[1])==7 or int(moji[1])==5:
	if int(moji[0])+int(moji[1])+int(moji[2])==17:
		print("YES")
	else:
		print("NO")
else:
	print("NO")