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.
abc = list(map(int,input().split()))
five_count = 0
seven_count = 0
for i in abc:
    if i == 5:
        five_count += 1
    elif i == 7:
        seven_count += 1
if five_count == 2 and seven_count == 1:
    print("Yes")
else:
    print("No")

abc = list(map(int,input().split()))
five_count = 0
seven_count = 0
for i in abc:
    if i == 5:
        five_count += 1
    elif i == 7:
        seven_count += 1
if five_count == 2 and seven_count == 1:
    print("YES")
else:
    print("NO")