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.
z = map(int,input().split())
num = 0
s = "NO"
for i in z:
  if z == 7:
    if num > 0:
      break
    num = 1
  elif not z == 5:
    break
  if i == z[2]:
    s = "YES"
print(s)
s = list(map(int,input().split()))
s = sorted(s)
if s[0]==5 and  s[1] == 5 and s[2] == 7:
  print("YES")
else:
  print("NO")