import sys input=lambda: sys.stdin.readline().rstrip() S=input() n=S.count("575") if n: print("YES") else: print("NO")