S = str(input()) key = '575' if key in S: print('YES') elif key not in S: print('NO')