import re s = input() if re.search("575",s): print("YES") else: print("NO")