s=input() answer='NO' for i in range(len(s)): if s[i]=='5' and s[i+1]=='7' and s[i+2]=='5': answer='YES' print(answer)