s = raw_input() if s.find("575")==0: print"YES" else: print"NO"