def main():
    S = input()
    if "575" in S:
        print("YES")
    else:
        print("NO")

if __name__ == '__main__':
    main()