import re

s = eval(input())

keyence = 'keyence'

for i in range(7):

    fs, es = keyence[:i], keyence[i:]

    # print(fs, es)

    fsis = [m.start() for m in re.finditer(fs, s)]

    esis = [m.start() for m in re.finditer(es, s)]

    for fsi in fsis:

        for esi in esis:

            # print(fsi, esi)

            if fsi + len(fs) <= esi:

                if es == 'keyence' and (esi == 0 or esi + len(es) == len(s)):

                    print('YES')

                    exit()

                elif fsi == 0 and esi + len(es) == len(s):

                    print('YES')

                    exit()

print('NO')
s = eval(input())

for i in range(7):

    if s[:i] + s[-7+i:] == 'keyence':

        print('YES')

        exit()

print('NO')
import re

s = eval(input())
keyence = "keyence"
for i in range(7):
    fs, es = keyence[:i], keyence[i:]
    # print(fs, es)
    fsis = [m.start() for m in re.finditer(fs, s)]
    esis = [m.start() for m in re.finditer(es, s)]
    for fsi in fsis:
        for esi in esis:
            # print(fsi, esi)
            if fsi + len(fs) <= esi:
                if es == "keyence" and (esi == 0 or esi + len(es) == len(s)):
                    print("YES")
                    exit()
                elif fsi == 0 and esi + len(es) == len(s):
                    print("YES")
                    exit()
print("NO")

s = eval(input())
for i in range(7):
    if s[:i] + s[-7 + i :] == "keyence":
        print("YES")
        exit()
print("NO")

-import re - -keyence = "keyence" -    fs, es = keyence[:i], keyence[i:] -    # print(fs, es) -    fsis = [m.start() for m in re.finditer(fs, s)] -    esis = [m.start() for m in re.finditer(es, s)] -    for fsi in fsis: -        for esi in esis: -            # print(fsi, esi) -            if fsi + len(fs) <= esi: -                if es == "keyence" and (esi == 0 or esi + len(es) == len(s)): -                    print("YES") -                    exit() -                elif fsi == 0 and esi + len(es) == len(s): -                    print("YES") -                    exit() +    if s[:i] + s[-7 + i :] == "keyence": +        print("YES") +        exit()