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()))
ans = 'No'
count_5 = 0
count_7 = 0

for abc in ABC:
    if abc==5:
        count_5 += 1
    elif abc==7:
        count_7 += 1
if count_5==2 and count_7==1:
    ans = 'Yes'
print(ans)

ABC = list(map(int,input().split()))
ans = 'NO'
count_5 = 0
count_7 = 0

for abc in ABC:
    if abc==5:
        count_5 += 1
    elif abc==7:
        count_7 += 1
if count_5==2 and count_7==1:
    ans = 'YES'
print(ans)
