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