A string is called a KEYENCE string when it can be changed to keyence by removing its…
- User
A string is called a KEYENCE string when it can be changed to
keyenceby 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, printNO.Examples
Input
keyofscience
Output
YES
Input
mpyszsbznf
Output
NO
Input
ashlfyha
Output
NO
Input
keyence
Output
YES
Assistant
pythons = input().strip() target = 'keyence' n = len(s) for i in range(len(target) + 1): prefix = target[:i] suffix = target[i:] if len(prefix) + len(suffix) > n: continue if s.startswith(prefix) and s.endswith(suffix): print("YES") exit() print("NO")
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.