S=input()
i=0
p="NO"
while i<len(S)-2 and p=="NO":
    if S[i]=="5" and S[i+1]=="7" and S[i+2]=="5":
        p="YES"
    i+=1
print(p)