import re text = input() pattern = r".*575.*" match = re.match(pattern, text) if match: print ("YES") else: print ("NO")