qyliang/CodeNanoFix huggingface dataset:
Buggy code:
L = list(map(int, input().split()))
L.sort()
if L == [1, 4, 7, 9]:
	print(YES)
else:
  	print(NO)

Fixed code:
input = list(map(int,input().split()))
input.sort()
if input == [1,4,7,9]:
    print("YES")
else:
    print("NO")
Buggy code:
n1, n2, n3, n4 = list(map(int, input().split()))
a = [n1, n2, n3, n4]
if 1 and 9 and 7 and 4 in a:
    print('YES')
else:
    print('NO')

Fixed code:
n1,n2,n3,n4 = list(map(int,input().split()))

n = [n1,n2,n3,n4]

if 1 in n and 9 in n and 7 in n and 4 in n:
    print("YES")
else:
    print("NO")
Buggy code:
a=sorted(list(int,input().split()))
if a==[1,4,7,9]:
  print("YES")
else:
  print("NO")

Fixed code:
a=sorted(map(int, input().split()))
if a==[1,4,7,9]:print('YES')
else:print('NO')
Buggy code:
n=list(map(int,input().split()))
s=[1,9,4,7]
if n==s:
  print("YES")
else:
  print("NO")

Fixed code:
n = list(map(int, input().split()))
n.sort()
if n == [1, 4, 7, 9]:
    print("YES")
else:
    print("NO")
Buggy code:
n = list(map(int, input().split()))
if "1" in n and "9" in n and "7" in n and "4" in n:
  print("YES")
else:
  print("NO")

Fixed code:
L = list(map(int, input().split()))

if 1 in L and 9 in L and 7 in L and 4:
    print('YES')
else:
    print('NO')
Buggy code:
a = list(map(int,input().split()))
a.sort()
print( 'YES' if a == [1,9,7,4] else 'NO' )


Fixed code:
a = list(map(int, input().split()))
print('YES' if sorted(a) == sorted([1, 9, 7, 4]) else 'NO')
Buggy code:
n1, n2, n3, n4 = input().split()
if {n1, n2, n3, n4} == {1, 9, 7, 4}:
  print("YES")
else:
  print("NO")

Fixed code:
n1, n2, n3, n4 = map(int, input().split())
if {n1, n2, n3, n4} == {1, 9, 7, 4}:
	print("YES")
else:
	print("NO")
Buggy code:
l=sorted(list(map(int,input(.split()))))
if l==[1,9,7,4]:
  print("YES")
else:
  print("NO")
         

Fixed code:
l = list(map(int,input().split()))
l = sorted(l)
if l == [1,4,7,9]:
    print('YES')
else:
    print('NO')
Buggy code:

KEY = "keyence"

def main():
    s = input()

    if s.startswith(KEY) or s.endswith(KEY):
        print("YES")
        return

    for i in range(1, len(KEY)):
        st = KEY[0:i]
        ed = KEY[i:]

        if s.startswith(st) and s.endswith(ed):
            print("YES")
            return

    print("No")

main()


Fixed code:

KEY = "keyence"

def main():
    s = input()

    if s.startswith(KEY) or s.endswith(KEY):
        print("YES")
        return

    for i in range(1, len(KEY)):
        st = KEY[0:i]
        ed = KEY[i:]

        if s.startswith(st) and s.endswith(ed):
            print("YES")
            return

    print("NO")

main()
Buggy code:
S = input()

key = list("keyence")

flg = False
for i in range(len(S)):
    for j in range(len(S)):
        tmp = S[0:i]+S[j:]

        if tmp == key and not flg:
            print("YES")
            flg = True
            break

if not flg:
    print("NO")


Fixed code:
S = input()

key = list("keyence")
target = 'keyence'

flg = False
for i in range(len(S)):
    for j in range(len(S)):
        tmp = S[0:i]+S[j:]

        if tmp == target and not flg:
            print("YES")
            flg = True
            break

if not flg:
    print("NO")
Buggy code:
S = input()
N = len(S)

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

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

print("NO")


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

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

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

print("NO")
Buggy code:
s = input()
target = "keyence"
for i in range(len(target) + 1):
    if target == s[:i] + s[len(s) - len(target) + i:]:
        print("YES")
        break
    else:
        print("NO")

Fixed code:
s = input()
target = "keyence"
ans = "NO"
for i in range(len(target) + 1):
    if target == s[:i] + s[len(s) - len(target) + i:]:
        ans = "YES"
        break
print(ans)
Buggy code:
s = input()

if s.startswith('k') and s.startswith('eyence'):
  print('YES')
elif s.startswith('ke') and s.startswith('yence'):
  print('YES')
elif s.startswith('key') and s.startswith('ence'):
  print('YES')
elif s.startswith('keye') and s.startswith('nce'):
  print('YES')
elif s.startswith('keyen') and s.startswith('ce'):
  print('YES')
elif s.startswith('keyenc') and s.startswith('e'):
  print('YES')
else:
  print('NO')

Fixed code:
s = input()

if s.startswith('k') and s.endswith('eyence'):
  print('YES')
elif s.startswith('ke') and s.endswith('yence'):
  print('YES')
elif s.startswith('key') and s.endswith('ence'):
  print('YES')
elif s.startswith('keye') and s.endswith('nce'):
  print('YES')
elif s.startswith('keyen') and s.endswith('ce'):
  print('YES')
elif s.startswith('keyenc') and s.endswith('e'):
  print('YES')
else:
  print('NO')
Buggy code:
S = input()

key = "keyence"

t = -1

for i in range(7):
    if not S[i] == key[i]:
        t = max(0, t + i)
        break

for i in range(1, 8):
    if not S[-i] == key[-i]:
        t = max(0, t + i - 1)
        break

if t >= 7 or t == -1:
    print("YES")
else:
    print("NO")



Fixed code:
S = input()

key = "keyence"

t = -1

for i in range(7):
    if not S[i] == key[i]:
        t = i
        break

if t == -1:
    t = 7

for i in range(1, 8):
    if not S[-i] == key[-i]:
        t += i - 1
        break

if t >= 7:
    print("YES")
else:
    print("NO")
Buggy code:
s = input()
S = len(s)

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

print("NO")

Fixed code:
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')
Buggy code:
s=input()
if(s[0:7]=='keyence'):
    print('YES')
elif(s[-7:]=='keyence'):
    print('YES')    
else:
    for i in range(7):
        t=s[0:i+1]+s[-6+i:]
        
        if(s[0:i+1]+s[-6+i:]=='keyence'):   
            print('YES')
            exit()
print('NO')      

Fixed code:
s=input()
if(s[0:7]=='keyence'):
    print('YES')
    exit()
elif(s[-7:]=='keyence'):
    print('YES')
    exit()    
else:
    for i in range(7):
        t=s[0:i+1]+s[-6+i:]
        
        if(s[0:i+1]+s[-6+i:]=='keyence'):   
            print('YES')
            exit()
print('NO')
Buggy code:
import re
s = input()
k = 'keyence'
ans = 'NO'
for i in range(len(k)):
    a = '^'+k[:i]+'.*?'+k[i:]+'$'
    print(a)
    if re.match(a,s):
        ans = 'YES'
print(ans)


Fixed code:
import re
s = input()
k = 'keyence'
ans = 'NO'
for i in range(len(k)):
    a = '^'+k[:i]+'.*?'+k[i:]+'$'
    if re.match(a,s):
        ans = 'YES'
print(ans)
Buggy code:
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil,pi,factorial
    from operator import itemgetter
    def I(): return int(input())
    def MI(): return map(int, input().split())
    def LI(): return list(map(int, input().split()))
    def LI2(): return [int(input()) for i in range(n)]
    def MXI(): return [[LI()]for i in range(n)]
    def SI(): return input().rstrip()
    def printns(x): print('\n'.join(x))
    def printni(x): print('\n'.join(list(map(str,x))))
    inf = 10**17
    mod = 10**9 + 7
#main code here!
    s=SI()
    n=len(s)
    for i in range(8):
        s1=s[:i]
        s2=s[n+i-7:]
 
        if s1+s2=="keyence":
            print("Yes")
            exit()
    print("No")
        








if __name__=="__main__":
    main()


Fixed code:
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil,pi,factorial
    from operator import itemgetter
    def I(): return int(input())
    def MI(): return map(int, input().split())
    def LI(): return list(map(int, input().split()))
    def LI2(): return [int(input()) for i in range(n)]
    def MXI(): return [[LI()]for i in range(n)]
    def SI(): return input().rstrip()
    def printns(x): print('\n'.join(x))
    def printni(x): print('\n'.join(list(map(str,x))))
    inf = 10**17
    mod = 10**9 + 7
#main code here!
    s=SI()
    n=len(s)
    for i in range(8):
        s1=s[:i]
        s2=s[n+i-7:]
 
        if s1+s2=="keyence":
            print("YES")
            exit()
    print("NO")
        








if __name__=="__main__":
    main()
Buggy code:
s = list(input())
ans = 'NO'
for i in range(len(s)):
    if ''.join(s[:i] + s[n-7+i:]) == 'keyence':
        ans = 'YES'
        break
print(ans)        

Fixed code:
s = list(input())
ans = 'NO'
for i in range(len(s)):
    if ''.join(s[:i] + s[len(s)-7+i:]) == 'keyence':
        ans = 'YES'
        break
print(ans)
Buggy code:
s = input()

word = "keyence"

for i in range(len(word)):
    a = s.find(word[:i])
    b = s.rfind(word[i:])
    if(a == b or (a == 0 and b == len(s)-len(word[i:]))):
        print("YES")
        exit()

print("NO")

Fixed code:
s = input()

word = "keyence"

for i in range(len(word)):
    a = s.find(word[:i])
    b = s.rfind(word[i:])
    if((a == 0 and b == 0) or (a == 0 and b == len(s)-len(word[i:]))):
        print("YES")
        exit()

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

Fixed code:
S = input()
keyence = "keyence"
for i in range(len(S)):
    for j in range(i,len(S)):
        new_str = S[:i] + S[j:]
        if new_str == keyence:
            print("YES")
            break
    else:
        continue
    break
else:
    print("NO")
Buggy code:
S = input()
if S[0:7] == "keyence":
    print("YES")
elif S[len(S)-8:len(S)-1] == "keyence":
    print("YES")
else:
    if (S[0] == "k")and(S[len(S)-7:len(S)-1] == "eyence"):
        print("YES")
    elif (S[0] == "ke")and(S[len(S)-6:len(S)-1] == "yence"):
        print("YES")
    elif (S[0] == "key")and(S[len(S)-5:len(S)-1] == "ence"):
        print("YES")
    elif (S[0] == "keye")and(S[len(S)-4:len(S)-1] == "nce"):
        print("YES")
    elif (S[0] == "keyen")and(S[len(S)-3:len(S)-1] == "ce"):
        print("YES")
    elif (S[0] == "keyenc")and(S[len(S)-2:len(S)-1] == "e"):
        print("YES")
    else:
        print("NO")


Fixed code:
S = input()
if S[0:7] == "keyence":
    print("YES")
elif S[len(S)-7:len(S)] == "keyence":
    print("YES")
else:
    if (S[0:1] == "k")and(S[len(S)-6:len(S)] == "eyence"):
        print("YES")
    elif (S[0:2] == "ke")and(S[len(S)-5:len(S)] == "yence"):
        print("YES")
    elif (S[0:3] == "key")and(S[len(S)-4:len(S)] == "ence"):
        print("YES")
    elif (S[0:4] == "keye")and(S[len(S)-3:len(S)] == "nce"):
        print("YES")
    elif (S[0:5] == "keyen")and(S[len(S)-2:len(S)] == "ce"):
        print("YES")
    elif (S[0:6] == "keyenc")and(S[len(S)-1:len(S)] == "e"):
        print("YES")
    else:
        print("NO")
Buggy code:
S=input()
l=len(S)
a=0
for i in range(l):
  for j in range(i+1,l):
    if S[:i]+S[j:]=="keyence":
      a=1
print(["NO","YES"][a])

Fixed code:
S=input()
l=len(S)
a=0
for i in range(l):
  for j in range(i,l):
    if S[:i]+S[j:]=="keyence":
      a=1
print(["NO","YES"][a])
Buggy code:
S = input()


def judge():
    L = len(S)
    keyence = 'keyence'
    if S[0] != 'k':
        if S[-7:] != 'keyence':
            return False
        else:
            return True
    else:
        for i in range(8):
            if S[0:i] == keyence[0:i] and S[L-(7-i):L] == keyence[i:7]:
                return True
        return False


def main():
    print(judge())

if __name__ == '__main__':
    main()


Fixed code:
S = input()


def judge():
    L = len(S)
    keyence = 'keyence'
    if S[0] != 'k':
        if S[-7:] != 'keyence':
            return False
        else:
            return True
    else:
        for i in range(8):
            if S[0:i] == keyence[0:i] and S[L-(7-i):L] == keyence[i:7]:
                return True
        return False


def main():
    if judge():
        print('YES')
    else:
        print('NO')

if __name__ == '__main__':
    main()
Buggy code:
s = str(input())
num = len(s)
for i in range(n):
  for j in range(i,n):
    if s[:i] + s[k:] == "keyence":
      print("YES")
      exit()
print("NO")

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

Fixed code:
S = input()

for i in range(8):
    if S[:i]+S[-(7-i):]=="keyence":
        print("YES")
        break
else:
    print("NO")
Buggy code:
s = input()

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

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

Fixed code:
s = input()

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

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

Fixed code:
s=input()
k="keyence"
t=""
for i in range(7):
  if k[i]!=s[i]:
    t+=k[:i]
    break
else:
  print("YES")
  exit()
print("YES" if t+s[i-7:]==k else "NO")
Buggy code:
S=input()
a=1
for i in range(len(S)):
  for j in range(len(S)-i):
    if S[:i]+S[i+j+1:]=='keyence':
      a=0
print('YNEOS'[a::2])

Fixed code:
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])
Buggy code:
S = input()


ans = True
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')


Fixed code:
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')
Buggy code:
A = str(input())

for i in range(len(A)):
  for j in range(len(A)):
    b =A[:i]+A[len(A)-j:len(A)]
    print(b)
    if b == "keyence":
      print("YES")
      exit()
    elif i==len(A):
      print("NO")
      exit()
    else:
      continue

Fixed code:
A = str(input())

for i in range(len(A)):
  for j in range(len(A)):
    b =A[:i]+A[len(A)-j:len(A)]
    if b == "keyence":
      print("YES")
      exit()
    else:
      continue
print("NO")
Buggy code:
S = input()
n = False
for i in range(len(S) + 1):
    for j in range(i, len(S) + 1):
        rest_str = S[:i] + S[j:]
        if rest_str == keyence:
            n = True
            break
    if n:
        break
if n:
	print("YES")
else:
    print("NO")

Fixed code:
S = input()
keyence = 'keyence'
n = False
for i in range(len(S) + 1):
    for j in range(i, len(S) + 1):
        rest_str = S[:i] + S[j:]
        if rest_str == keyence:
            n = True
            break
    if n:
        break
if n:
	print("YES")
else:
    print("NO")
Buggy code:
S = input()


x = "keyence"

if S[:7] == x:
    print("YES")
    exit()

for i in range(0,len(x)):
    print(S[:i]== x[:i] , S[-(7-i):] == x[i:])
    if S[:i]== x[:i] and S[-(7-i):] == x[i:] :
        print("YES")
        exit()
    # tr:
    #     index1 = S.index(x[:i])
    #     index2 = S.rindex(x[i:])
    #     print(index1,index2)
    #     if index1==0 and index2+i == len(S) and index1<index2:
    #         print(index1,index2)
    #         print("YES")
    #         exit()
    # except ValueError:
    #     continue
print("NO")

Fixed code:
S = input()


x = "keyence"

if S[:7] == x:
    print("YES")
    exit()

for i in range(0,len(x)):
    if S[:i]== x[:i] and S[-(7-i):] == x[i:] :
        print("YES")
        exit()
    # tr:
    #     index1 = S.index(x[:i])
    #     index2 = S.rindex(x[i:])
    #     print(index1,index2)
    #     if index1==0 and index2+i == len(S) and index1<index2:
    #         print(index1,index2)
    #         print("YES")
    #         exit()
    # except ValueError:
    #     continue
print("NO")
Buggy code:
import re

s = input()
key = 'keyence'
x = 0

str0 = re.compile(r'^' + key)
str1 = re.compile(r'' + key + '$')
if str0.search(s) != None or str1.search(s) != None:
  x = 1
  print(str0.search(s))
  print(str1.search(s))
else:
  for i in range(7):
    str0 = re.compile(r'^' + key[i:])
    str1 = re.compile(r'' + key[:-(6-i)] + '$')
    if str0.search(s) != None and str1.search(s) != None:
      x = 1
      print(str0.search(s))
      print(str1.search(s))

if x == 1:
  print('YES')
else:
  print('NO')

Fixed code:
import re

s = input()
key = 'keyence'
x = 0

str0 = re.compile(r'^' + key)
str1 = re.compile(r'' + key + '$')

if str0.search(s) != None or str1.search(s) != None:
  x = 1
else:
  for i in range(1,7):
    if x == 1:
      break
    str0 = re.compile(r'^' + key[:i])
    str1 = re.compile(r'' + key[i-6:] + '$')
    if str0.search(s) != None and str1.search(s) != None:
      x = 1

if x == 1:
  print('YES')
else:
  print('NO')
Buggy code:
S = list(input())
s1 = list("keyence")

x = [1]
y = [1]
for i in range(7):
  if S[i] == s1[i]:
    x.append(x[i-1])
  if S[len(S)-1-i] == s1[6-i]:
    y.append(y[i-1])
  

if sum(x) + sum(y) >= 9:
  print("YES")  
else:
  print("NO")

Fixed code:
S = list(input())
s1 = list("keyence")

x = [1]
y = [1]
for i in range(7):
  if S[i] == s1[i]:
    x.append(x[len(x)-1])
  else:
    x.append(0)
  if S[len(S)-1-i] == s1[6-i]:
    y.append(y[len(y)-1])
  else:
    y.append(0)

if sum(x) + sum(y) >= 9:
  print("YES")  
else:
  print("NO")
Buggy code:
def main() :
	S = input()

	remove_len = len(S)  - 7

	for i in range(len(S) - remove_len) :
		s = S[i:i+7]
		if (s == "keyence") :
			print("YES")
			return

	print("NO")


main()

Fixed code:
def main() :
	S = input()

	remove_len = len(S)  - 7

	for i in range(len(S) - remove_len) :
		# s = S[i:i+7]
		s = S[0:i] + S[i+remove_len:]
		if (s == "keyence") :
			print("YES")
			return

	print("NO")


main()
Buggy code:
#15 B - KEYENCE String
S = list(input())

result = 'NO'

for i in range(len(S)):
    Scpy = S.copy()
    for j in range(i,len(S)):
        Scond = Scpy[:i]+Scpy[j:]
        print(Scond)
        if (''.join(Scond)) == ('keyence'):
            result = 'YES'
            break
    else:
        continue
    break
print(result)

Fixed code:
#15 B - KEYENCE String
S = list(input())

result = 'NO'
for i in range(len(S)):
    Scpy = S.copy()
    for j in range(i,len(S)):
        Scond = Scpy[:i]+Scpy[j:]
        if (''.join(Scond)) == ('keyence'):
            result = 'YES'
            break
    else:
        continue
    break
print(result)
Buggy code:
S = input()
N = len(S)
 
for i in range(7+1):
  if S[:i] + S[i+N-7:] == "keyence":
    print("YES")
    break
print("NO")

Fixed code:
S = input()
N = len(S)
 
for i in range(7+1):
  if S[:i] + S[i+N-7:] == "keyence":
    print("YES")
    exit()
print("NO")
Buggy code:
S=input()
length=len(S)
ans='NO'
if S[0:7]=='keyence':
    ans='Yes'
elif S[-7:]=='keyence':
    ans='Yes'
elif S[0]=='k' and S[-6:]=='eyence':
    ans='Yes'
elif S[0:2]=='ke' and S[-5:]=='yence':
    ans='Yes'
elif S[0:3]=='key' and S[-4:]=='ence':
    ans='Yes'
elif S[0:4]=='keye' and S[-3:]=='nce':
    ans='Yes'
elif S[0:5]=='keyen' and S[-2:]=='ce':
    ans='Yes'
elif S[0:6]=='keyenc' and S[-1:]=='e':
    ans='yes'

print(ans)

Fixed code:
S=input()
length=len(S)
ans='NO'
if S[0:7]=='keyence':
    ans='YES'
elif S[-7:]=='keyence':
    ans='YES'
elif S[0]=='k' and S[-6:]=='eyence':
    ans='YES'
elif S[0:2]=='ke' and S[-5:]=='yence':
    ans='YES'
elif S[0:3]=='key' and S[-4:]=='ence':
    ans='YES'
elif S[0:4]=='keye' and S[-3:]=='nce':
    ans='YES'
elif S[0:5]=='keyen' and S[-2:]=='ce':
    ans='YES'
elif S[0:6]=='keyenc' and S[-1:]=='e':
    ans='YES'

print(ans)
Buggy code:
S = input().rstrip()

if S[:7] == 'keyence':
    print('YES')
    exit()
if S[-7:] == 'keyence':
    print('YES')
    exit()

for i in range(1, len(S)):
    for j in range(i, len(S)):
        if S[0:i]+S[j+1:] == 'keyence':
            print('Yes')
            exit()
print('No')


Fixed code:
S = input().rstrip()

if S[:7] == 'keyence':
    print('YES')
    exit()
if S[-7:] == 'keyence':
    print('YES')
    exit()

for i in range(1, len(S)):
    for j in range(i, len(S)):
        if S[0:i]+S[j+1:] == 'keyence':
            print('YES')
            exit()
print('NO')
Buggy code:
S=input()
l=len(S)
a=0
for i in range(l):
  for j in range(i,l):
    print(S[:i]+S[j:])
    if S[:i]+S[j:]=="keyence":
      a=1
      break
  if a==1:
    break
print(["NO","YES"][a])

Fixed code:
S=input()
l=len(S)
a=0
for i in range(l):
  for j in range(i,l):
    if S[:i]+S[j:]=="keyence":
      a=1
      break
  if a==1:
    break
print(["NO","YES"][a])
Buggy code:
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")
        

            
            
            
    

Fixed code:
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")
Buggy code:
S=[i for i in list(input())];N=len(S);k=['k','e','y','e','n','c','e']
for d in range(N-6):
    for i in range(N-d+1):
        s=S[:i]+S[i+d:];if s==k:
            print('YES');quit()
print('NO')

Fixed code:
S=[i for i in list(input())];N=len(S);k=['k','e','y','e','n','c','e']
for d in range(N-6):
    for i in range(N-d+1):
        s=S[:i]+S[i+d:]
        if s==k:
            print('YES');quit()
print('NO')
Buggy code:
S = str(input())
s = input()
for i in range(len(s)):
    for j in range(i, len(s)):
        a = s[:i] + s[j:]
        if a == "keyence":
            print("YES")
            exit()
print("NO")


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