import re

def solve(S):
    patterns = ['^.*keyence$', '^k.*eyence$', '^ke.*yence$', '^key.*ence$',
                '^keye.*nce$', '^keyen.*ce$', '^keyenc.*e$', '^keyence.*$']
    for p in patterns:
        if re.match(p, S):
            return 'YES'
    return 'NO'