a = str(input()) if a.find("575")==-1: print("NO") else: print("YES")