s = input() for i in range(len(s) - 2): if s[i:i+2] == "575": print("YES") break else: print("NO")