Problem:
 Score : 200 points    Problem Statement A string is called a KEYENCE string when it can be changed to keyence by removing its contiguous substring (possibly empty) only once.  Given a string S consisting of lowercase English letters, determine if S is a KEYENCE string.      Constraints  The length of S is between 7 and 100 (inclusive).  S consists of lowercase English letters.         Input Input is given from Standard Input in the following format:  S       Output If S is a KEYENCE string, print YES ; otherwise, print NO .        Sample Input 1 keyofscience      Sample Output 1 YES  keyence is an abbreviation of key of science .       Sample Input 2 mpyszsbznf      Sample Output 2 NO       Sample Input 3 ashlfyha      Sample Output 3 NO       Sample Input 4 keyence      Sample Output 4 YES

Solution (Python):
s = input()
k = 'keyence'
flg_pre = 0
flg_post = 0
pre_match = 0
post_match = 0
if s[:6] == k or s[-7:] == k:
  print('YES')
else:
  for i in range(6):
    if s[i] == k[i] and flg_pre == 0:
      pre_match = i + 1
    else:
      flg_pre = 1
    if s[-i-1] == k[-i-1] and flg_post == 0:
      post_match = i + 1
    else:
      flg_post = 1
  if  pre_match + post_match >= 7:
    print('YES')
  else:
    print('NO')

Solution (Python):
S = input()
remove = len(S) - 7
print('YES' if any(S[:i] + S[i+remove:] == 'keyence' for i in range(8)) else 'NO')

Solution (Python):
def main():
    S = input()
    n = len(S)
    key = 'keyence'
    if S == key:
        print('YES')
        return
    for i, k in enumerate(key):
        if S[i] != k:
            rest = key[i:]
            for j in range(i, n):
                
                if S[j:] == rest:
                    print('YES')
                    return
            prinｔ('NO')
            return
    print('NO')
main()

Solution (Python):
S = input()

target = "keyence"
N = len(target)

for i in range(8):
    s = S[:i] + S[len(S) - N + i :]
    if s == target:
        print("YES")
        break
else:
    print("NO")

Solution (Python):
import sys
s=input()
for i in range(len(s)):
    for j in range(i,len(s)):
        t=s[:i]+s[i:]
        if s[:i]+s[j:]=="keyence": print("YES");sys.exit()
print("NO")

Solution (Python):
s = input()
for i in range(8):
    if s[:i]+s[len(s)-(7-i):] == 'keyence':
        print('YES')
        exit(0)
print('NO')

Solution (Python):
s = input()
rs = s[::-1]
for i in range(8):
    
    if s[:i]+s[len(s)-(7-i):] == 'keyence':
        print('YES')
        exit(0)
print('NO')

Solution (Python):
s = input()

for i in range(len(s)):
    for j in range(i, len(s)+1):
        if s[:i] + s[j:] == "keyence":
            print("YES")
            exit()

print("NO")

Solution (Python):
s = input()
key = 'keyence'

pre = 0
for c,t in zip(s[:7], key):
    if c == t:
        pre += 1
back = 0
for c,t in zip(s[-7:], key):
    if c == t:
        back += 1
        
print('YES' if pre + back >= len(key) else 'NO')

Solution (Python):
s = input()
ans = 'keyence'
cnt = 0

for i in range(7):
    if s[i] != ans[i]:
        break
    cnt += 1

for i in range(7):
    if s[len(s) - i - 1] != ans[6 - i]:
        break
    cnt += 1

if cnt >= 7:
    ans = 'YES'
else:
    ans = 'NO'
print(ans)

Solution (Python):
s = input()
for start in range(len(s)):
    for end in range(start, len(s)+1):
        st = s[:start]+s[end:]
        if st=='keyence':
            print('YES')
            exit()

print('NO')

Solution (Python):
S = input()

if S == "keyence":
    print("YES")
    exit()

for i in range(len(S) - 1):
    for j in range(i + 1, len(S) + 1):
        
        if S[:i] + S[j:] == "keyence":
            print("YES")
            exit()

print("NO")

Solution (Python):
S = input()
li = ['k','ke','key','keye','keyen','keyenc']
lia = ['eyence','yence','ence','nce','ce','e']
for i in range(6):
    if S.startswith(li[i]) and S.endswith(lia[i]):
        print("YES")
        exit()
print("NO")

Solution (Python):
S = input()
 
N = len(S)
for i in range(N):
    for j in range(i, N + 1):
        if S[:i] + S[j:] == "keyence":
            print("YES")
            quit()
print("NO")

Solution (Python):
s = input()

for i in range(len(s)):
    if s[:i] + s[i+len(s)-7:] == 'keyence':
        print('YES')
        break
else:
    print('NO')

Solution (Python):
def main():
    word = input()
    target = "keyence"
    target_length = len(target)
    answer = "NO"
    if word[:target_length] == target or word[-target_length:] == target:
        answer = "YES"
    else:
        for i in range(1, target_length):
            if word[:i] == target[:i] and word[-target_length + i:] == target[-target_length + i:]:
                answer = "YES"
                break
    print(answer)


if __name__ == '__main__':
    main()

Solution (Python):
s = input()

for i in range(len(s)):
    if s[:i] + s[i+len(s)-7:] == 'keyence':
        print('YES')
        break
else:
    print('NO')

Solution (Python):
s=input()
for i in range(len(s)):
    for j in range(i, len(s)+1):
        if s[:i]+s[j:]=='keyence':
            print('YES')
            exit()
print('NO')

Solution (Python):
S = input()
ls = ['k', 'e', 'y', 'e', 'n', 'c', 'e']
is_ng = True
idx = 0
tmp = 0
for i in range(len(ls)):
    l = S[:i]
    r = S[-len(ls)+i:]
    if l+r == 'keyence':
        is_ng=False

print('YNEOS'[is_ng::2])

Solution (Python):
S = input()

N = len(S)
for i in range(N):
    for j in range(i, N + 1):
        if S[:i] + S[j:] == "keyence":
            print("YES")
            quit()
print("NO")

Solution (Python):
S = input()

V = "keyence"
t = len(S) - len(V)

for i in range(len(S) - t + 1):
    if S[:i] + S[i+t:] == V:
        print("YES")
        exit(0)
print("NO")

Solution (Python):
def main():
    s = input().rstrip()
    f = False
    for i in range(len(s)):
        for j in range(len(s)-i):
            if s[:j]+s[j+i:] == "keyence":
                f = True
    if f:
        print("YES")
    else:
        print("NO")

if __name__ == "__main__":
    main()

Solution (Python):
def main():
    S = input()
    s = 'keyence'
    for i in range(len(s)+1):
        if S.startswith(s[:i]) and S.endswith(s[i:]): return True
    return False

if __name__ == '__main__':
    print('YES' if main() else 'NO')

Solution (Python):
s = input()
cant = 1
for i in range(len(s)):
        for j in range(i, len(s)):
                if s[:i]+s[j:]=="keyence": cant = 0
print("YNEOS"[cant::2])

Solution (Python):
def main():
    S = input()
    s = 'keyence'
    for i in range(len(s)+1):
        judge = True
        for j in range(i):
            if s[j] != S[j]:
                judge = False
                break
        for j in range(len(s)-i):
            if s[-1-j] != S[-1-j]:
                judge = False
                break
        if judge:
            return True
    return False

if __name__ == '__main__':
    print('YES' if main() else 'NO')

Solution (Python):
S = input()
key = "keyence"
ans = "NO"
for i in range(8):
    left = key[0:i]
    right = key[i:8]
    if S[0:i] == left and S[len(S)-7+i:len(S)] == right:
        ans = "YES"
print(ans)

Solution (Python):
from fractions import gcd
from math import sqrt
from collections import deque,defaultdict,Counter
from heapq import heapify,heappop,heappush
from copy import deepcopy
from itertools import accumulate,permutations
from bisect import bisect_left,bisect_right

S = input()

flag = False
for sta in range(len(S)):
    for end in range(sta,len(S)):
        if S[:sta] + S[end:] == "keyence":
            flag = True

if flag:
    print("YES")
else:
    print("NO")

Solution (Python):
S = input()
target = 'keyence'
if target in S:
    print('YES')
    exit()
l = 0
r = 0
while S[l] == target[l]:
    l += 1
while S[len(S)-r-1] == target[6-r]:
    r += 1
if l + r >= 7:
    print('YES')
else:
    print('NO')

Solution (Python):
import sys
input = sys.stdin.readline
S = list(input())[: -1]
for l in range(len(S)):
  for r in range(l, len(S)):
    t = S[: l] + S[r: ]
    if "".join(t) == "keyence":
      print("YES")
      exit(0)
print("NO")

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7

s = STR()
l = len(s)
a = 'keyence'
flag = False
for i in range(l - 6): 
    for j in range(l - i + 1): 
        if s[:j] + s[i+j:] == a:
            print('YES')
            exit()
print('NO')

Solution (Python):
def main():
    S = input()
    N = len(S)
    for i in range(N):
        for j in range(N+1):
            T = S[:i] + S[i+j:]  
            if T == "keyence":
                return print("YES")
    print("NO")


if __name__ == '__main__':
    main()

Solution (Python):
S=input()
count=0
for i in range (len(S)-1):
	for j in range(i,len(S)):
		if S[:i]+S[j:]=="keyence":
			count=1
if count==0:
	print("NO")
else:
	print("YES")

Solution (Python):



S = input()
s_length = len(S)


is_same = False
for i in range(s_length):
    for j in range(i, s_length):
        
        tmp_str = S[:i+1] + S[j:]
        if tmp_str=="keyence":
            is_same = True
            break

if is_same:
    print("YES")
else:
    print("NO")

Solution (Python):
s = input()
n = len(s)
k = "keyence"
nk =len(k)

for i in range(nk + 1):
  if s[:i] + s[i + n - nk:] == k:
    print("YES")
    exit()
print("NO")

Solution (Python):
s = str(input())
for i in range(len(s)):
    for j in range(i,len(s)):
        if (s[:i] + s[j:]) == "keyence":
            print("YES")
            exit()
print("NO")

Solution (Python):
s = input()
flag = 1
for i in range(100):
        for j in range(100):
                if s[:j] + s[j+i:]=="keyence":
                        flag = 0
print("YNEOS"[flag::2])

Solution (Python):
s = str(input())
t = 'keyence'

if len(s) < len(t):
    print('NO')
    exit()

if s[0:len(t)] == t:
    print('YES')
    exit()

if s[len(s)-len(t):len(s)] == t:
    print('YES')
    exit()

for i in range(len(t)):
    if s[0:i+1] == t[0:i+1] and s[len(s)-len(t)+(i+1):len(s)] == t[(i+1):len(t)]:
        print('YES')
        exit()
else:
    print('NO')

Solution (Python):
s = input()
target = 'keyence'
l = len(s)
for i in range(l - 6): 
    
    for j in range(l - i + 1): 
        a = s[:j] + s[j+i:]
        
        if a == target:
            print('YES')
            exit()
print('NO')

Solution (Python):
def main():
    S = input()
    N = len(S)
    ans = "keyence"
    for i in range(N):
        for j in range(N+1):
            T = S[:i] + S[i+j:]  
            if T == ans:
                return print("YES")

    print("NO")


if __name__ == '__main__':
    main()

Solution (Python):


def is_keyence(target: str):
    key = "keyence"

    if target == key:
        return True

    for i in range(len(target)):
        for j in range(i, len(target)):
            tmp = ""
            if i > 0:
                tmp += target[0:i]
            if j < len(target) - 1:
                tmp += target[j + 1:]
            if tmp == key:
                return True
    return False


print("YES" if is_keyence(input().rstrip()) else "NO")

Solution (Python):
S = input()
s = 'keyence'

ans = 'NO'
for i in range(len(s)):
    judge = True
    for j in range(i):
        if S[j] != s[j]: judge = False
    for j in range(-1,-len(s)+i-1,-1):
        if S[j] != s[j]: judge = False
    if judge: ans ='YES'
print(ans)

Solution (Python):
S=input()
tgt="keyence"
res=S==tgt
for i in range(8):
    T = ''
    if 0<i: T+=S[:i]
    if i<7: T+=S[i-7:]
    
    if T==tgt:
        res=True
print("YES" if res else "NO")

Solution (Python):
S = input()
for i in range(1,8):
    temp = S[:i] + S[-(7-i):]
    if temp == 'keyence':
        print('YES')
        exit()
print('NO')

Solution (Python):
S = input()

flag = False
for sta in range(len(S)):
    for end in range(sta, len(S)):
        if S[:sta] + S[end:] == "keyence":
            flag = True

if flag:
    print("YES")
else:
    print("NO")

Solution (Python):
import sys
input = sys.stdin.readline
S = list(input())[: -1]
for l in range(len(S)):
  for r in range(l, len(S)):
    t = S[: l] + S[r: ]
    if "".join(t) == "keyence":
      print("YES")
      exit(0)
print("NO")

Solution (Python):
s = input()
k = "keyence"
j = 0
"""
for i in range(len(s)):
    if s[i]==k[j]:
        j+=1
    if j==7:
        print("YES")
        exit()
"""

for i in range(7):
    if s[:i]+s[-7+i:]==k:
        print("YES")
        exit()

print("NO")

Solution (Python):
s=str(input())
num=len(s)-7

ans="NO"

if num==0:
    if s=="keyence":
        ans="YES"

s=s+"!"

s1=""
s2=s[0:num]
s3=s[num:]

for _ in range(8):
    if s1+s3=='keyence!':
        ans="YES"
        break
    s1=s1+s2[0]
    s2=s2[1:]+s3[0]
    s3=s3[1:]

print(ans)

Solution (Python):
s = input()

master = "keyence"

i = 0
f = 0

if(s[0:7] == master or s[-7:] == s):
    print("YES")
else:
    i = 0
    while (s[i] == master[i]):
        i += 1
    if (s[-7+i:] == master[i:]):
        print("YES")
    else:
        print("NO")

Solution (Python):
S=input()
N=len(S)
s1=""
s2=""
s3=""
flag=0
keyence="keyence"
for i in range(1,N):
    for j in range(i+1,N):
        for k in range(N):
            if k<i:
                s1="".join((s1,S[k]))
            elif k<j:
                s2="".join((s2,S[k]))
            else:
                s3="".join((s3,S[k]))
        
        if ("".join((s1,s2))==keyence)or("".join((s1,s3))==keyence)or("".join((s2,s3))==keyence)or("".join((s1,s2,s3))==keyence):
            flag=1
            break
        s1=""
        s2=""
        s3=""
    if flag==1:
        break
if flag==1:
    print("YES")
else:
    print("NO")

Solution (Python):
s=input()
p='keyence'
l=len(s)
for i in range(l):
  for j in range(l):
    if s[:i]+s[j:]==p:
      print('YES')
      exit()
print('NO')

Solution (Python):
s=input()
ans="NO"
t="keyence"
for i in range(8):
    if s[:i]==t[:i] and s[len(s)-7+i:]==t[i:]:
        ans="YES"
        break
print(ans)

Solution (Python):
s = input()
t = 'keyence'
for i in range(8):
  
  if s[:i] == t[:i] and s[i-7:] == t[i-7:]:
    print('YES')
    break
else:
  print('NO')

Solution (Python):
s = input()

def main(string):
    c = "keyence"
    head = string[:7]

    idx = 0
    for s in head:
        if s == c[idx]: idx += 1
        else: break
    if idx == 7:
        print("YES")
        return

    tail = string[-7+idx:]
    for s in tail:
        if s == c[idx]: idx += 1
        else: break        
    
    if idx == 7:
        print("YES")
    else:
        print("NO")

main(s)

Solution (Python):
Key_str = 7

S = str(input())
count =0

if len(S)<Key_str:
    print("No")

else:
    del_str = len(S)-Key_str
    
    for i in range(len(S)-del_str):
        try_str = S[:i] + S[i+del_str:]
        if try_str == 'keyence':
            print("YES")
            count+=1
            break
    if count==0:
        print("NO")

Solution (Python):
s = input()
k = "keyence"
a = "YES"
for i in range(len(s)):
    if s[i] == k[i]: continue
    else:
        if s[-(7-i):] == k[i:]:
            break
        else:
            a = "NO"
            break
print(a)

Solution (Python):
S=input()
a=1
for i in range(len(S)):
  for j in range(len(S)-i):
    if S[:i]+S[i+j:]=='keyence':
      a=0
print('YNEOS'[a::2])

Solution (Python):
S=input()
T="keyence"
for i in range(len(T)+1):
    if S.startswith(T[:i])and S.endswith(T[i:]):
        print("YES")
        break
else:
    print("NO")

Solution (Python):
str1 = "keyence"
str2 = input()
f = False
for i in range(len(str2)):
    for j in range(i, len(str2)):
        if str2[:i] + str2[j:] == str1:
            f = True
print("YES" if f else "NO")

Solution (Python):
s=input()
c=0
if 'keyence' in s:
  c=1
if s[:1]=='k' and s[-6:]=='eyence':
  c=1
if s[:2]=='ke' and s[-5:]=='yence':
  c=1
if s[:3]=='key' and s[-4:]=='ence':
  c=1
if s[:4]=='keye' and s[-3:]=='nce':
  c=1
if s[:5]=='keyen' and s[-2:]=='ce':
  c=1
if s[:6]=='keyenc' and s[-1:]=='e':
  c=1

print('YES' if c==1 else 'NO')

Solution (Python):
s = input()
k = 'keyence'
res = 'NO'
if s[:len(k)]==k or s[len(s)-len(k):]==k:
    res = 'YES'
else:
    for i in range(len(k)+1):
        if s[:i]+s[len(s)-len(k)+i:] == k:
            res = 'YES'
            break
print(res)

Solution (Python):
S = input()
Flg = "NO"

for i in range(7):
    if(S[:i] + S[-7+i:] == "keyence"):
        Flg = "YES"
        break
print(Flg)

Solution (Python):
S = input()

ans = False
if S == 'keyence':
    ans = True
else:
    for i in range(len(S)):
        for j in range(i, len(S)):
            p1 = S[:i]
            b = S[i:j+1]
            p2 = S[j+1:]
            
            
            
            
            if p1 + p2 == 'keyence':
                ans = True

if ans:
    print('YES')
else:
    print('NO')

Solution (Python):
S = input()

ans = False
if S == 'keyence':
    ans = True
elif S.startswith('keyence') or S.endswith('keyence'):
    ans = True
else:
    for i in range(len(S)):
        for j in range(i, len(S)):
            p1 = S[:i]
            b = S[i:j+1]
            p2 = S[j+1:]
            
            if p1 + p2 == 'keyence':
                ans = True

if ans:
    print('YES')
else:
    print('NO')

Solution (Python):
s = input()
import re
if "keyence" == s:
    print("YES")
    exit()

if re.fullmatch(".*keyence",s) is not None:
    print("YES")
    exit()

if re.fullmatch("k.*eyence",s) is not None:
    print("YES")
    exit()
if re.fullmatch("ke.*yence",s) is not None:
    print("YES")
    exit()
if re.fullmatch("key.*ence",s) is not None:
    print("YES")
    exit()
if re.fullmatch("keye.*nce",s) is not None:
    print("YES")
    exit()
if re.fullmatch("keyen.*ce",s) is not None:
    print("YES")
    exit()
if re.fullmatch("keyenc.*e",s) is not None:
    print("YES")
    exit()
if re.fullmatch("keyence.*",s) is not None:
    print("YES")
    exit()
print("NO")

Solution (Python):
s = input()
k = 'keyence'
r = 'NO'
for i in range(len(k)):
    if s[:i] + s[-7+i:] == k:
        r = 'YES'
        break
print(r)

Solution (Python):



from fractions import gcd 
from functools import reduce
import sys
sys.setrecursionlimit(200000000)
from inspect import currentframe




def printargs2err(*args):
    names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' : '+repr(arg) for arg in args),file=sys.stderr)
def debug(x):
    print(x,file=sys.stderr)
def printglobals():
    for (symbol, value) in globals().items():
        print('symbol="%s"、value=%s' % (symbol, value),file=sys.stderr)
def printlocals():
    for (symbol, value) in locals().items():
        print('symbol="%s"、value=%s' % (symbol, value),file=sys.stderr)

def pin(type=int):
    return map(type,input().split())

def worstdata():
    a=0
    return a

def vacation(N,act):
    lastact =[]
    dp=[0,max(act[0])]*(N+1) 
    
    return 0




S=input()
window=len(S)-7
k="keyence"
cond=0
for i in range(7):
    c=S[0:i]+S[i+window:]
    
    if c==k:
        cond=1
        break


print(["NO","YES"][cond])

Solution (Python):
s = input()
key = 'keyence'

if len(s) < len(key):
    print('NO')
else:
    for i in range(len(key)):
        if s[:i] + s[-7+i:] == key:
            print('YES')
            break
    else:
        print('NO')

Solution (Python):
def examA():
    N = LI()
    N.sort()
    if N==[1,4,7,9]:
        print("YES")
    else:
        print("NO")
    return

def examB():
    S = SI()
    K = "keyence"
    for i in range(7):
        if S[:i]+S[-7+i:]==K:
            print("YES")
            return
    if S[:7]==K:
        print("YES")
        return
    print("NO")
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math,random
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

if __name__ == '__main__':
    examB()

"""

"""

Solution (Python):
S = input()
flag = False
for L in range(8):
	T = S[:L] + S[len(S)-(7-L):]
	if T == "keyence":
		flag = True
		break
print("YES" if flag else "NO")

Solution (Python):


s=input()
m="keyence"
if s=="keyence":
    print("YES")
elif s[0:7]=="keyence":
    print("YES")
elif s[-8:-1]=="keyence":
    print("YES")
elif s[0]=="k" and s[-1]=="e":
    ans = "NO"
    for i in range(6):
        if s[0:i+1]==m[0:i+1] and s[-6+i:]==m[-6+i:]:
            ans="YES"
    print(ans)

else:
    print("NO")

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]

def main():
	S = sys.stdin.readline()

	counter = 0
	if(S[0]!='k'):
		if(S[-8:-1]=='keyence'):
			print("YES")
		else:
			print("NO")
	elif(S[0]=="k" and S[-2]!="e"):
		if(S[0:7]=='keyence'):
			print("YES")
		else:
			print("NO")
	elif(S[0]=="k" and S[-2]=="e"):
		key = "keyence"
		f = False
		for i in range(1,7):
			if(key == str(S[0:i])+str(S[-8+i:-1])):
				print("YES")
				f = True
				break
		if f==False : print("NO")
	else:
		print("NO")

main()

Solution (Python):
s=str(input())
if s=="keyence":
  print("YES")
  exit()
f=False
for i in range(len(s)-1):
  for j in range(i+1,len(s)):
    if s[:i]+s[j:]=="keyence":
      f=True
      break
print("YES" if f==True else "NO")

Solution (Python):
S = input()


ans = False
for i in range(len(S)):
    for j in range(i, len(S)):
        moji = S[:i] + S[j:]
        if moji == 'keyence':
            ans = True
            break

if ans:
    print('YES')
else:
    print('NO')

Solution (Python):
s = input()
end = len(s)
flg = False
for i in range(end):
    for j in range(i,end):
        string = s[:i] + s[j:]
        if string == 'keyence':
            flg = True
            break
            
print('YES' if flg else 'NO')

Solution (Python):
s=input()
for i in range(len(s)):
	for j in range(i,len(s)+1):
		if s[:i]+s[j:]=='keyence':
			print('YES')
			break
	else:
		continue
	break
else:
	print('NO')

Solution (Python):
import sys
from collections import defaultdict, deque
import bisect
from heapq import *
from math import factorial, ceil, floor
from collections import defaultdict
import itertools
sys.setrecursionlimit(200000)
input = sys.stdin.readline









S = list(input().strip())

for i in range(len(S)):
    for j in range(i, len(S)+1):
        c = "".join(S[:i] + S[j:])
        if c == "keyence":
            print("YES")
            exit()
print("NO")

Solution (Python):
s = input()
l = "keyence"
if s[0:7] == l:
    print("YES")
elif s[-7:] == l:
    print("YES")
else:
    for i in range(7):
        if s[:i+1] == l[:i+1] and s[i-6:] == l[i+1:]:
            print("YES")
            exit()
    print("NO")

Solution (Python):
S = input()
ky = "keyence"
for i in range(len(ky)):
    s = ky[:i]
    t = ky[i:]
    if s in S and t in S:
        if s == S[:i] and t == S[i-7:]:
            print("YES")
            exit()
print("NO")

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    s = input()
    WORD = 'keyence'

    l = len(s)
    for i in range(l):
        for j in range(i, l):
            if s[:i] + s[j:] == WORD:
                print('YES')
                exit()
    print('NO')
    
    
if __name__ == '__main__':
    main()

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    s = input()
    for l in range(len(s)):
        for r in range(l,len(s)):
            a = s[:l]+s[r:]
            if a == "keyence":
                print("YES")
                return
    print("NO")
    return


if __name__ == "__main__":
    solve()

Solution (Python):
s = input()

k = 'keyence'

tmp = s
ans = ''
for i in range(len(s)-1):
  for j in range(i, len(s)):
    tmp = s
    tmp = tmp[0:i] + tmp[j:]
    if k == tmp:
      print('YES')
      exit(0)
print('NO')

Solution (Python):
S = input()
id = 0
keyence = "keyence"
for i in range(len(S)):
    if S[i] == keyence[id]:
        id += 1
    else:
        break
id2 = 1
for i in reversed(range(id, len(S))):
    if S[i] == keyence[-id2]:
        id2 += 1
    else:
        break

if id + id2 - 1 >= 7:
    print("YES")
else:
    print("NO")

Solution (Python):
S = input()
flag = False
for i in range(len(S)):
  for j in range(i, len(S)):
    if S[:i] + S[j:] == "keyence":
      flag = True
if flag:
  print("YES")
else:
  print("NO")

Solution (Python):




import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

s = input()
if s[:1] == 'k' and s[-6:] == 'eyence':
    print('YES')
elif s[:2] == 'ke' and s[-5:] == 'yence':
    print('YES')
elif s[:3] == 'key' and s[-4:] == 'ence':
    print('YES')
elif s[:4] == 'keye' and s[-3:] == 'nce':
    print('YES')
elif s[:5] == 'keyen' and s[-2:] == 'ce':
    print('YES')
elif s[:6] == 'keyenc' and s[-1:] == 'e':
    print('YES')
elif s[:7] == 'keyence' or s[-7:] == 'keyence':
    print('YES')
else:
    print('NO')

Solution (Python):
s = input()
n = len(s)
k = 'keyence'
for i in range(7):
    if s[i] != k[i]:
        break
else:
    i += 1
tmp = i
for i in range(7):
    if s[n - i - 1] != k[6 - i]:
        break
else:
    i += 1
if i + tmp >= 7:
    print('YES')
else:
    print('NO')

Solution (Python):
def main():
    s = input()

    good = 'keyence'

    for start in range(len(s)):
        for end in range(len(s)):
            if s.replace(s[start:end],'',1) == good:
                print('YES')
                exit()

    print('NO')

if __name__ == '__main__':
    main()

Solution (Python):
keyence = "keyence"

S = input()

flag = False
for sta in range(len(S)):
    for end in range(sta,len(S)):
        if S[:sta] + S[end:] == keyence:
            flag = True

if flag:
    print("YES")
else:
    print("NO")

Solution (Python):
s=input()
key="keyence"
n=len(s)
for i in range(n-1):
    for j in range(1,n):
        if s[:i]+s[j:]==key:
            print("YES")
            exit()
print("NO")

Solution (Python):
S=input()
N=len(S)
for i in range(N):
    for j in range(i,N):
        if S[:i]+S[j:]=="keyence":
            print("YES")
            break
    else:
        continue
    break
else:
    print("NO")

Solution (Python):
s = input()
cnt = 0
for i in range(len(s)):
    for j in range(len(s)):
        if s[:i]+s[j:] == 'keyence':
            cnt += 1
if cnt > 0:
    print("YES")
else:
    print("NO")

Solution (Python):
s=input()
n=len(s)
for i in range(n):
    for j in range(i,n+1):
        if 'keyence'==s[:i]+s[j:]:
            print('YES')
            exit()
print('NO')

Solution (Python):











import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,hypot,log 
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    S=ST()
    N = len(S)
    for l in range(N):
        for r in range(l,N):
            if S[:l]+S[r:]=="keyence":
                print("YES")
                return
    print("NO")
if __name__ == '__main__':
    main()

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  s=S()

  if s[-7:]=='keyence':
    return 'YES'
  if s[:7]=='keyence':
    return 'YES'
  if s[0]=='k' and s[-6:]=='eyence':
    return 'YES'
  if s[:2]=='ke' and s[-5:]=='yence':
    return 'YES'
  if s[:3]=='key' and s[-4:]=='ence':
    return 'YES'
  if s[:4]=='keye' and s[-3:]=='nce':
    return 'YES'
  if s[:5]=='keyen' and s[-2:]=='ce':
    return 'YES'
  if s[:6]=='keyenc' and s[-1]=='e':
    return 'YES'
  return 'NO'


print(main())

Solution (Python):
S = input()
s = 'keyence'
if S[:7] == s or S[-7:] == s:
    print('YES')
    exit()

for i in range(1, 7):
    if S[:i] == s[:i] and S[-7 + i:] == s[i:]:
        print('YES')
        exit()
else:
    print('NO')

Solution (Python):
S=input()
count= 0
for i in range(len(S)):
    for j in range(len(S)):
        if S[:i]+S[j:]=="keyence":
            count += 1
if count == 0:
    print("NO")
else:
    print("YES")

Solution (Python):
S=input();N=len(S)
for i in range(len(S)):
  if(S[:i]+S[N-7+i:]=="keyence"):
    print("YES")
    exit()
print("NO")