output_description: If S is a KEYENCE string, print `YES`; otherwise, print `NO`.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      S
attempt: S = list(input())
  if "k" and "e" and "y" and "e" and "n" and "c" and "e" in S:
      for i in range(len(S)):
          if S[i] == "k":
              if S[i + 1] == "e":
                  if S[i + 2] == "y":
                      if S[i + 3] == "e":
                          if S[i + 4] == "n":
                              if S[i + 5] == "c":
                                  if S[i + 6] == "e":
                                      print("YES")
                                      break
                                  else:
                                      if S[-1] == "e":
                                          print("YES")
                                          break
                                      else:
                                          print("No")
                                          break
                              else:
                                  if S[-1] == "e" and S[-2] == "c":
                                      print("YES")
                                      break
                                  else:
                                      for j in range(len(S) - i - 5):
                                          if S[i + 5 + j] == "c":
                                              if S[i + 5 + j + 1] == "e":
                                                  if i + 5 + j + 2 == len(S):
                                                      print("YES")
                                                      break
                                                  else:
                                                      print("NO")
                                                      break
                                              else:
                                                  print("NO")
                                                  break
                          else:
                              if S[-1] == "e" and S[-2] == "c" and S[-3] == "n":
                                  print("YES")
                                  break
                              else:
                                  for j in range(len(S) - i - 4):
                                      if S[i + 4 + j] == "n":
                                          if S[i + 4 + j + 1] == "c":
                                              if S[i + 4 + j + 2] == "e":
                                                  if i + 4 + j + 3 == len(S):
                                                      print("YES")
                                                      break
                                                  else:
                                                      print("NO")
                                                      break
                                              else:
                                                  print("NO")
                                                  break
                                          else:
                                              print("NO")
                                              break
                      else:
                          if (
                              S[-1] == "e"
                              and S[-2] == "c"
                              and S[-3] == "n"
                              and S[-4] == "e"
                          ):
                              print("YES")
                              break
                          else:
                              for j in range(len(S) - i - 3):
                                  if S[i + 3 + j] == "e":
                                      if S[i + 3 + j + 1] == "n":
                                          if S[i + 3 + j + 2] == "c":
                                              if S[i + 3 + j + 3] == "e":
                                                  if i + 3 + j + 4 == len(S):
                                                      print("YES")
                                                      break
                                                  else:
                                                      print("NO")
                                                      break
                                              else:
                                                  print("NO")
                                                  break
                                          else:
                                              print("NO")
                                              break
                                      else:
                                          print("NO")
                                          break
                  else:
                      if (
                          S[-1] == "e"
                          and S[-2] == "c"
                          and S[-3] == "n"
                          and S[-4] == "e"
                          and S[-5] == "y"
                      ):
                          print("YES")
                          break
                      else:
                          for j in range(len(S) - i - 2):
                              if S[i + 2 + j] == "y":
                                  if S[i + 2 + j + 1] == "e":
                                      if S[i + 2 + j + 2] == "n":
                                          if S[i + 2 + j + 3] == "c":
                                              if S[i + 2 + j + 4] == "e":
                                                  if i + 2 + j + 5 == len(S):
                                                      print("YES")
                                                      break
                                                  else:
                                                      print("NO")
                                                      break
                                              else:
                                                  print("NO")
                                                  break
                                          else:
                                              print("NO")
                                              break
                                      else:
                                          print("NO")
                                          break
                                  else:
                                      print("NO")
                                      break
              else:
                  if (
                      S[-1] == "e"
                      and S[-2] == "c"
                      and S[-3] == "n"
                      and S[-4] == "e"
                      and S[-5] == "y"
                      and S[-6] == "e"
                  ):
                      print("YES")
                      break
                  else:
                      for j in range(len(S) - i - 1):
                          if S[i + 1 + j] == "e":
                              if S[i + 1 + j + 1] == "y":
                                  if S[i + 1 + j + 2] == "e":
                                      if S[i + 1 + j + 3] == "n":
                                          if S[i + 1 + j + 4] == "c":
                                              if S[i + 1 + j + 5] == "e":
                                                  if i + 1 + j + 6 == len(S):
                                                      print("YES")
                                                      break
                                                  else:
                                                      print("NO")
                                                      break
                                              else:
                                                  print("NO")
                                                  break
                                          else:
                                              print("NO")
                                              break
                                      else:
                                          print("NO")
                                          break
                                  else:
                                      print("NO")
                                      break
                              else:
                                  print("NO")
                                  break
  else:
      print("NO")
  
problem_description: 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.
samples: [{"input": "keyofscience", "output": "YES\n    \n\n`keyence` is an abbreviation of `key of science`.\n\n* * *"}, {"input": "mpyszsbznf", "output": "NO\n    \n\n* * *"}, {"input": "ashlfyha", "output": "NO\n    \n\n* * *"}, {"input": "keyence", "output": "YES"}]