S = input() c1 = 0 c2 = 0 for i in range(len(S)): if(S[i] == '5'): c1 += 1 if(S[i] == '7'): c2 += 1 if(c1+c2 >= 3): print("YES") else: print("NO")