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.
a,b,c = input().split(" ")
if len(a)==7:
  if len(b)==5 and len(c)==5:
    print("YES")
  else:print("NO")
if len(b)==7:
  if len(a)==5 and len(c)==5:
    print("YES")
  else:print("NO")
if len(c)==7:
  if len(b)==5 and len(a)==5:
    print("YES")
  else:print("NO")


flagY = 0
flagN = 0
a,b,c = [int(i) for i in input().split(" ")]
if a==7:
  if b==5 and c==5:
    flagY = 1
  else:
    flagN = 1
if b==7:
  if a==5 and c==5:
    flagY = 1
  else:
    flagN = 1
if c==7:
  if b==5 and a==5:
    flagY = 1
  else:
    flagN = 1
if flagY ==1:print("YES")
elif flagY == 0:print("NO")