S = input()
for i in range(len(S) - 2):
    if S[i] == '5' and S[i + 1] == '7' and S[i + 2] == '5':
        print('YES')
        exit()
print('NO')