print("YES" if str(input()).count("575") else "NO")