S = input() N = S.count('575') if N > 0: print('YES') else: print('NO')