qyliang/CodeNanoFix huggingface dataset:
Buggy code:
S = input()

match = "keyence"
check = ""
revcheck = ""

flag = False

for x in range(len(S)):
    if x == len(match):
        break
    if match[x] == S[x]:
        check += S[x]
    else:
        flag = True
        break

if flag:
    remainFlag = False
    remain = S[x + 1:]
    revS = "".join(reversed(S))
    revMatch = "".join(reversed(remain))
    for y in range(len(revS)):
        # print(revS[y])
        if y == len(revMatch):
            remainFlag = True
            break
        if revMatch[y] == revS[y]:
            revcheck += revS[y]
        else:
            break
    if remainFlag:
        print("YES")
    else:
        print("NO")
elif check == match:
    print("YES")
else:
    print("NO")


Fixed code:
S = input()

match = "keyence"
check = ""
revcheck = ""

flag = False

for x in range(len(S)):
    if x == len(match):
        break
    if match[x] == S[x]:
        check += S[x]
    else:
        flag = True
        break

if flag:
    remainFlag = False
    remain = match[x:]
    revS = "".join(reversed(S))
    revMatch = "".join(reversed(remain))
    for y in range(len(revS)):
        # print(revS[y])
        if y == len(revMatch):
            remainFlag = True
            break
        if revMatch[y] == revS[y]:
            revcheck += revS[y]
        else:
            break
    if remainFlag:
        print("YES")
    else:
        print("NO")
elif check == match:
    print("YES")
else:
    print("NO")
Buggy code:
s=input()

n=len(s)
flag=False
for i in range(n):
    for j in range(i,n):
        if (s[:i]+s[j:])=='keyence':
            flag=True
        print(s[:i]+s[j:])
print('YES' if flag else 'NO')


Fixed code:
s=input()

n=len(s)
flag=False
for i in range(n):
    for j in range(i,n):
        if (s[:i]+s[j:])=='keyence':
            flag=True
print('YES' if flag else 'NO')
Buggy code:
ans_word = "keyence"

s = input()
flag = False

for i in range(len(s)-1):
    for j in range(len(s)-1):
        if s[:i] + s[j:] == ans_word:
            flag = True
            break
    if flag:
        break
if flag:
    print("YES")
else:
    print("No")


Fixed code:
ans_word = "keyence"

s = input()
flag = False
if s == ans_word:
    flag = True
else:
    for i in range(len(s)-1):
        for j in range(i+1, len(s)):
            if s[:i] + s[j:] == ans_word:
                flag = True
                break
        if flag:
            break

if flag:
    print("YES")
else:
    print("NO")
Buggy code:
s = input()

flag = False
n = len(s)
for i in range(n):
    for j in range(i,n):
        print(s[:i] +s[j:])
        if 'keyence' == s[:i] +s[j:]:
            flag = True

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

Fixed code:
s = input()

flag = False
n = len(s)
for i in range(n):
    for j in range(i,n):
        if 'keyence' == s[:i] +s[j:]:
            flag = True

if flag:
    print('YES')
else:
    print('NO')
Buggy code:
# coding: utf-8
s = input()
key = 'keyence'
key_r = 'ecneyek'
j = 0
for i in key:
    if s[j] == i:
        j += 1
    else:
        break
k = -1
for i in key_r:
    if s[k] == i:
        k -= 1
    else:
        break

s = s[:j] + s[k + 1:]
if j >= k+1: s = key
if s == key:
    print('YES')
else:
    print('NO')

Fixed code:
# coding: utf-8
s = input()
key = 'keyence'
key_r = 'ecneyek'
j = 0
for i in key:
    if s[j] == i:
        j += 1
    else:
        break
k = 1
for i in key_r:
    if s[-k] == i:
        k += 1
    else:
        break

s = s[:j] + s[-k+1:]
if j + k > 7:
    s = key
if s == key:
    print('YES')
else:
    print('NO')
Buggy code:
s=input()

n=len(s)
ans="NO"

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

Fixed code:
s=input()

n=len(s)
ans="NO"

for i in range(n):
  for j in range(1,n+1):
    num=s[:i]+s[j:]
    if num == "keyence":
      ans="YES"
      
print(ans)
Buggy code:
s = input()
fl = 0
for i in range(len(s)):
    for j in range(len(s)):
        if i <= j:
            tmp = s[:i] + s[j:]
            if tmp == "keyence":
                flg = 1
if flg == 1:
    print("YES")
else:
    print("NO")

Fixed code:
s = input()
flg = 0
for i in range(len(s)):
    for j in range(len(s)):
        if i <= j:
            tmp = s[:i] + s[j:]
            if tmp == "keyence":
                flg = 1
if flg == 1:
    print("YES")
else:
    print("NO")
Buggy code:
s=input()
t="keyence"

if t in s:
  if s.find(t)==0 or s.find(t)==len(s)-7:
    print("YES")
  else:
    print("NO")
else:
  for i in range(1,7):
    a,b=t[:i],t[i:]
    print(a,b)
    if a in s and b in s:
      if s.find(a)==0 and s.rfind(b)==len(s)-len(b):
        print("YES")
        break
  else:
    print("NO")

Fixed code:
s=input()
t="keyence"

if t in s:
  if s.find(t)==0 or s.find(t)==len(s)-7:
    print("YES")
  else:
    print("NO")
else:
  for i in range(1,7):
    a,b=t[:i],t[i:]
    if a in s and b in s:
      if s.find(a)==0 and s.rfind(b)==len(s)-len(b):
        print("YES")
        break
  else:
    print("NO")
Buggy code:
s = input()
for i in range(7):
    if s[i] + s[-7 + i] == "keyence":
        print("YES")
        exit()
print("NO")

Fixed code:
s = input()
for i in range(7):
    if s[:i] + s[-7 + i:] == "keyence":
        print("YES")
        exit()
print("NO")
Buggy code:
S=input()
flag=0
for i in range(len(S)):
    for j in range(i+1,len(S)):
        if S[0:i]+S[j:] == 'keyence':
            flag=1
if flag==1:
    print("YES")
else:
    print("NO")

Fixed code:
S=input()
if S == "keyence":
  print("YES")
else:

  flag=0
  for i in range(len(S)):
      for j in range(i+1,len(S)):
          if S[0:i]+S[j:] == 'keyence':
              flag=1
  if flag==1:
      print("YES")
  else:
      print("NO")
Buggy code:
s=(input())
n=len(s)
l=n-7
for i in range(l):
    tmp=s[:i]+s[i+l:]
    if tmp=="keyence":
        print("YES")
        exit()
print("NO")


Fixed code:
s=input()
n=len(s)
for i in range(n):
    tmp=s[:i]+s[i+n-7:]
    if tmp=="keyence":
        print("YES")
        exit()
print("NO")
Buggy code:
S=input()
# print(S)
if S=="keyence":
	print("Yes")
	exit(0)
a="keyence"
# print(len(a))
for i in range(1,len(a)):
	# print(i)
	# print(S[0:i])
	# print(a[0:i])
	# print(S[len(S)+i-len(a):len(S)])
	# print(a[i:len(S)])
	
	if S[0:i]==a[0:i] and S[len(S)+i-len(a):len(S)]==a[i:len(S)]:
		print("YES")
		exit(0)
print("NO")
exit(0)


Fixed code:
S=input()
# print(S)
if S=="keyence":
	print("YES")
	exit(0)
a="keyence"
if S[0:len(a)]==a:
	print("YES")
	exit(0)

# print(len(a))
for i in range(0,len(a)):
	# print(i)
	# print(S[0:i])
	# print(a[0:i])
	# print(S[len(S)+i-len(a):len(S)])
	# print(a[i:len(S)])
	
	if S[0:i]==a[0:i] and S[len(S)+i-len(a):len(S)]==a[i:len(S)]:
		print("YES")
		exit(0)
print("NO")
exit(0)
Buggy code:
S=input()
key='keyence'
ans='NO'
for i in range(len(key)):
    key1=key[:i]
    key2=key[i:]
    A=key1+'0'*(len(S)-len(key))+key2
    for l in range(len(S)):
        if all([S[l]==A[l] or A[l]=='0' for l in range(len(S))]):
            ans='YES'
            print(A)
print(ans)

Fixed code:
S=input()
key='keyence'
ans='NO'
for i in range(len(key)):
    key1=key[:i]
    key2=key[i:]
    A=key1+'0'*(len(S)-len(key))+key2
    if all([S[l]==A[l] or A[l]=='0' for l in range(len(S))]):
        ans='YES'
print(ans)
Buggy code:
u=str(input())
S=u.replace(' ','z')
print(S)
A=[]
for i in range(len(S)+1):
    for j in range(len(S)+1):
        if i<=j:
            A.append(S.replace(S[i-1:j],'',1))
if 'keyence' in A:
    print('YES')
else:
    print('NO')

Fixed code:
u=str(input())
S=u.replace(' ','z')
A=[]
for i in range(len(S)+1):
    for j in range(len(S)+1):
        if i<=j:
            A.append(S.replace(S[i-1:j],'',1))
if 'keyence' in A:
    print('YES')
else:
    print('NO')
Buggy code:
import sys

S = input()
target = "keyence"
del_len = len(S) - len(target)

if S=="target":
    print("YES")
else:
    for i in range(len(S) - del_len+1):
        s = S[:i] + S[i + del_len:]
        print(s)
        if s==target:
            print("YES")
            sys.exit()
print("NO")

Fixed code:
import sys

S = input()
target = "keyence"
del_len = len(S) - len(target)

for i in range(len(S) - del_len+1):
    s = S[:i] + S[i + del_len:]
    if s==target:
        print("YES")
        sys.exit()
print("NO")
Buggy code:
import copy
key = list(input())
hantei=0
length=len(key)
for i in range(length):
    if hantei==1:
        break
    a=copy.deepcopy(key)
    if i==length-1:
        j=length-2
    else:
        j=i
    while j<length-1:
        del a[i]
        j+=1
        if "".join(a)=="keyence":
            hantei=1
            break
if hantei==1:
    print("YES")
else:
    print("NO")
       

Fixed code:
import copy
key = list(input())
hantei=0
length=len(key)
if "".join(key)=="keyence":
    hantei=1
for i in range(length):
    if hantei==1:
        break
    a=copy.deepcopy(key)
    if i==length-1:
        j=length-2
    else:
        j=i
    while j<length-1:
        del a[i]
        j+=1
        if "".join(a)=="keyence":
            hantei=1
            break
if hantei==1:
    print("YES")
else:
    print("NO")
Buggy code:
s = str(input()); n = len(s)
kn = 7
if n < kn:
  print("NO")
for i in range(kn):
  temp = s[:i] + s[n-kn+i:]
  if temp == "keyence":
    print("YES")
    exit()
print("No")

Fixed code:
s = str(input()); n = len(s)
kn = 7
if n < kn:
  print("NO")
  exit()
for i in range(kn):
  temp = s[:i] + s[n-kn+i:]
  if temp == "keyence":
    print("YES")
    exit()
print("NO")
Buggy code:
S=input()
sk="keyence"
N=len(S)
Nsk=len(sk)

k=0
ans="N0"
if N>=Nsk:
    for i in range(Nsk):
        temp=S[0:i]+S[N-Nsk+i:]
        if temp==sk:
            ans="YES"
    
print(ans)

Fixed code:
S=input()
sk="keyence"
N=len(S)
Nsk=len(sk)

k=0
ans="NO"
if N>=Nsk:
    for i in range(Nsk):
        temp=S[0:i]+S[N-Nsk+i:]
        if temp==sk:
            ans="YES"
    
print(ans)
Buggy code:
s=input()
rem = len(s)-7

if s[rem:] == 'keyence': 
    print('YES')
    exit()
for i in range(8):
    news = s[0:i] + s[i+rem:]
    if news == 'keyence':
        print('YES')
        break
    print(news)
else:
    print('NO')

Fixed code:
s=input()
rem = len(s)-7

if s[rem:] == 'keyence': 
    print('YES')
    exit()
for i in range(8):
    news = s[0:i] + s[i+rem:]
    if news == 'keyence':
        print('YES')
        break
else:
    print('NO')
Buggy code:
# coding:utf-8
s = input()
for i in range(n := len(s))
	if s[:i] + s[n-7+i:] == 'keyence':
    	print('YES')
		exit()
print('NO')

Fixed code:
# coding:utf-8
s = input()
n = len(s)
for i in range(n):
    if s[:i] + s[n-7+i:] == 'keyence':
        print('YES')
        exit()
print('NO')
Buggy code:
S=input()
for i in range(8):
    if S[:i]+S[len(S)-6+i:] == 'keyence':
        print('YES')
        exit()
print('NO')


Fixed code:
S=input()
for i in range(8):
    if S[:i]+S[len(S)-7+i:] == 'keyence':
        print('YES')
        exit()
print('NO')
Buggy code:
S = input()
L = len(S)
Truth = 0

for j in range(0, 8):
	if S[0:j] + S[L- 7 +j:] = "keyence":
		Truth = 1

if Truth =1:
	print(YES)
else:
	print(NO)

Fixed code:
S = input()
L = len(S)
Truth = 0

for j in range(0, 8):
	if S[0:j] + S[L- 7 +j:] == "keyence":
		Truth = 1

if Truth ==1:
	print("YES")
else:
	print("NO")
Buggy code:
S = input()
L = len(S)


for i in range(L):
    count = 0
    for j in range(i, L):
        if (i == 0 and count == 0):
            s = S[1:]
        elif(i == L - 1):
            s = S[:i]
        else:
            s = S[:i] + S[i + count + 1:]

        if (s == 'keyence'):
            print('YES')
            exit()
        else:
            count += 1

print('NO')


Fixed code:
S = input()
L = len(S)

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

for i in range(L):
    count = 0
    for j in range(i, L):
        if (i == 0 and count == 0):
            s = S[1:]
        elif(i == L - 1):
            s = S[:i]
        else:
            s = S[:i] + S[i + count + 1:]

        if (s == 'keyence'):
            print('YES')
            exit()
        else:
            count += 1

print('NO')
Buggy code:
if S[0:7]=='keyence':
    OK = True
elif S[l-7:]=='keyence':
    OK = True
elif S[l-6:]=='eyence' and S[0]=='k':
    OK = True
elif S[l-5:]=='yence' and S[:2]=='ke':
    OK = True
elif S[l-4:]=='ence' and S[:3]=='key':
    OK = True
elif S[l-3:]=='nce' and S[:4]=='keye':
    OK = True
elif S[l-2:]=='ce' and S[:5]=='keyen':
    OK = True
elif S[l-1:]=='e' and S[:6]=='keyenc':
    OK = True
else:
    OK = False
print('YES' if OK else 'NO')



Fixed code:
S = input()
l = len(S)
OK = False
if S[0:7]=='keyence':
    OK = True
elif S[l-7:]=='keyence':
    OK = True
elif S[l-6:]=='eyence' and S[0]=='k':
    OK = True
elif S[l-5:]=='yence' and S[:2]=='ke':
    OK = True
elif S[l-4:]=='ence' and S[:3]=='key':
    OK = True
elif S[l-3:]=='nce' and S[:4]=='keye':
    OK = True
elif S[l-2:]=='ce' and S[:5]=='keyen':
    OK = True
elif S[l-1:]=='e' and S[:6]=='keyenc':
    OK = True
else:
    OK = False
print('YES' if OK else 'NO')
Buggy code:
s=input()
k='keyence'
if k in s:
    exit(print('YES'))

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


Fixed code:
s=input()
k='keyence'
if k in s:
    exit(print('YES'))

for i in range(len(k)):
    #print(s[:i], s[len(k)-i:])
    if s[:i]+s[len(s)-len(k)+i:] == k:
        exit(print('YES'))
print('NO')
Buggy code:
text = input()
i = 0
ans = "keyence"
for ob_n in range(len(lists)):
    if text[i] != lists[ob_n]:
        if text.endswith(ans[ob_n:]):
            flag = 1
            break
        else:
            flag = 0
            break
    i+=1
    if i == len(text):
        flag = 1
        break
if flag == 1:
    print("YES")
else :
    print("NO")
        

Fixed code:
text = input()
i = 0
ans = "keyence"
for ob_n in range(len(ans)):
    if text[i] != ans[ob_n]:
        if text.endswith(ans[ob_n:]):
            flag = 1
            break
        else:
            flag = 0
            break
    i+=1
    if i == len(text):
        flag = 1
        break
if flag == 1:
    print("YES")
else :
    print("NO")
Buggy code:

def solve(s):
  t = 'keyence'
  if t in s[0:7] or t in s[-7:]:
    return 'YES'

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

print(solve(input()))

Fixed code:

def solve(s):
  t = 'keyence'
  if t in s[0:7] or t in s[-7:]:
    return 'YES'

  p = 0
  for i in range(len(s)):
    if t[p] == s[i]:
      p = p + 1
    else:
      if t[p:] in s[-7+p:]:
        return 'YES'
      else:
        return 'NO'
  return 'NO'

print(solve(input()))
Buggy code:
import copy

S = list(input())
ja = 0

sremove = ""
S_tmp = []

for i in range(len(S)):
    for j in range(i,len(S)+1):
        S_tmp = copy.deepcopy(S)

        del S_tmp[i:j]
        print(i,j)
        print(S_tmp)

        if "".join(S_tmp) == "keyence":
            ja = 1
            break

if ja == 1:
    print("YES")

else:
    print("NO")


Fixed code:
import copy

S = list(input())
ja = 0

sremove = ""
S_tmp = []

for i in range(len(S)):
    for j in range(i,len(S)+1):
        S_tmp = copy.deepcopy(S)

        del S_tmp[i:j]

        if "".join(S_tmp) == "keyence":
            ja = 1
            break

if ja == 1:
    print("YES")

else:
    print("NO")
Buggy code:
s = str(input())
n = len(s)
if s == "keyence":
 print("YES")
 exit()
else:
 for I in range(8):
  t = s[0:I]+s[I+n-7:n]
  print(t)
  if t == "keyence":
   print("YES")
   exit()
print("NO")

Fixed code:
s = str(input())
n = len(s)
if s == "keyence":
 print("YES")
 exit()
else:
 for I in range(8):
  t = s[0:I]+s[I+n-7:n]
  if t == "keyence":
   print("YES")
   exit()
print("NO")
Buggy code:

s = input()

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


Fixed code:
s = input()

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

Fixed code:
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")
Buggy code:
import sys
S = list(input())
Ans_list=['k','e','y','e','n','c','e']
Ans = 0
for i in range(len(S)):
    for j in range(i,len(S),+1):
        
        if (S[:i:]+S[j::]) == Ans_list:
           Ans = 1
           print(Ans)
           sys.exit()
print(Ans)

Fixed code:
import sys
S = list(input())
Ans_list=['k','e','y','e','n','c','e']
Ans = 'NO'
for i in range(len(S)):
    for j in range(i,len(S),+1):
        
        if (S[:i:]+S[j::]) == Ans_list:
           Ans = 'YES'
           print(Ans)
           sys.exit()
print(Ans)
Buggy code:
s = input()
search="keyence"
idx=0
flg = False
ans="NO"
n = len(s)
if s[0:7] == search:
    print("YES")
elif (s[-7:] == search):
    print("YES")
else:
    for i in range(7):
        if s[0:i+1] == search[0:i+1]:
            print(s[(-7+i+1):])
            print(search[i+1:])
            if (s[(-7+i+1):] == search[i+1:]):
                ans = "YES"
                break
    print(ans)


Fixed code:
s = input()
search="keyence"
idx=0
flg = False
ans="NO"
n = len(s)
if s[0:7] == search:
    print("YES")
elif (s[-7:] == search):
    print("YES")
else:
    for i in range(7):
        if s[0:i+1] == search[0:i+1]:
            #print(s[(-7+i+1):])
            #print(search[i+1:])
            if (s[(-7+i+1):] == search[i+1:]):
                ans = "YES"
                break
    print(ans)
Buggy code:
S = str(input())

flg = False

if S=="keyence":
    print("OK")
else:
    for i in range(len(S)+1):
        
        for j in range(i,len(S)+1):
            
            temp = S[0:i]+S[j:]
            
            if temp =="keyence":
                flg = True
                break
                
        if flg == True:
            break
        
    if flg == True:
        print("YES")
    else:
        print("NO")
            

Fixed code:
S = str(input())

flg = False

if S=="keyence":
    print("YES")
else:
    for i in range(len(S)+1):
        
        for j in range(i,len(S)+1):
            
            temp = S[0:i]+S[j:]
            
            if temp =="keyence":
                flg = True
                break
                
        if flg == True:
            break
        
    if flg == True:
        print("YES")
    else:
        print("NO")
Buggy code:
def solve(s):
    n = len(s)
    for i in range(n):
        for j in range(i+1,n):
            if s[:i] + s[j:] == "keyence":
                return "YES"
    return "NO"

s = input()
print(solve(s))

Fixed code:
def solve(s, t="keyence"):
    if s == t:
        return "YES"
    n = len(s)
    for i in range(n):
        for j in range(i+1,n):
            if s[:i] + s[j:] == t:
                return "YES"
    return "NO"

s = input()
print(solve(s))
Buggy code:
s = input()
k,n,c = "keyence",len(s),0
for i in range(8):
	if k[:i]==s[:i] and k[i:]==s[n+i-8:]: break
	else: c+=1
if c-8: print("NO")
else: print("YES")

Fixed code:
s = input()
k,n,c = "keyence",len(s),0
for i in range(8):
	if k[:i]==s[:i] and k[i:]==s[n+i-7:]: break
	else: c+=1
if c-8: print("YES")
else: print("NO")
Buggy code:
s=input()ß
s=list(s)
a=list('keyence')
for i in range(8):
    if s[:i]==a[:i] and s[i-7:]==a[i-7:]:
        print('YES')
        quit()
print('NO')

Fixed code:
s=input()
s=list(s)
a=list('keyence')
for i in range(8):
    if s[:i]==a[:i] and s[i-7:]==a[i-7:]:
        print('YES')
        quit()
print('NO')
Buggy code:
S=input()
for i in range(7):
    if S[i+1:]+S[-6+i:]=='keyence':
        print('YES')
        exit()
print('NO')

Fixed code:
S = input()
for i in range(7):
    if S[:i] + S[i-7:] == 'keyence':
        print('YES')
        exit()
print('NO')
Buggy code:
s = input()
check = 'keyence'

if s[0] != 'k' and s[-1] != 'e':
    print('NO')
else:
    if s[:7] == check or s[-7:] == check:
        print('YES')
    else:
        for i in range(1, 7):
            if s[:i] + s[-(7 - i):] == check:
                print('YES')
                exit()
            # print(s[:i], s[-(7 - i):])
    print('NO')


Fixed code:
s = input()
check = 'keyence'

if s[0] != 'k' and s[-1] != 'e':
    print('NO')
else:
    if s[:7] == check or s[-7:] == check:
        print('YES')
        exit()
    else:
        for i in range(1, 7):
            if s[:i] + s[-(7 - i):] == check:
                print('YES')
                exit()
                # print(s[:i], s[-(7 - i):])
    print('NO')
Buggy code:
import re

def main():
    N = str(input())
    if re.match("^.*keyence$", N) or re.match("^k.*eyence$", N) or re.match("^ke.*yence$", N) or re.match("^key.*ence$", N) or re.match("^keye.*nce$", N) or re.match("^keyen.*ce$", N) or re.match("^keyenc.*e$", N) or re.match("^keyence.*$", N):
        print("Yes")
    else:
        print("No")



if __name__ == "__main__":
    main()

Fixed code:
import re

def main():
    N = str(input())
    if re.match("^.*keyence$", N) or re.match("^k.*eyence$", N) or re.match("^ke.*yence$", N) or re.match("^key.*ence$", N) or re.match("^keye.*nce$", N) or re.match("^keyen.*ce$", N) or re.match("^keyenc.*e$", N) or re.match("^keyence.*$", N):
        print("YES")
    else:
        print("NO")



if __name__ == "__main__":
    main()
Buggy code:
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(8):
        if S[:i]+S[-7+i:0]==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()

"""

"""

Fixed code:
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()

"""

"""
Buggy code:
s=input()
flag=1
for i in range(len(s)):
  for j in range(1,len(s)-i+1):
    if (s[:i]+s[i+j:])=='keyence':
      flag*=0
if flag==0:
  print('YES')
else:
  print('NO')

Fixed code:
s=input()
flag=1
if s=='keyence':
  flag=0
for i in range(len(s)):
  for j in range(1,len(s)-i+1):
    if (s[:i]+s[i+j:])=='keyence':
      flag*=0
if flag==0:
  print('YES')
else:
  print('NO')