if input().count("575") > 0: print("YES") else: print("NO")