N = input() print("YES") if N.find("575") != -1 else print("NO")