S = input() X = S.count('575') if X >= 1: print("YES") else: print("NO")