s=input()
for i in range(len(s)):
    if s[i:i+3]=='575': print('YES');exit()
print('NO')