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