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 in Fortran (gfortran v4.8.4) (judge verdict: Accepted)

program prob2
    implicit none
    integer::i,j,k,L
    character(len=100)::S
    read(*,*) S
    L = len_trim(S)
    if(S(1:7) .eq. "keyence")then
        write(*,*) "YES"
        stop
    else if(S(L-6:L) .eq. "keyence")then
        write(*,*) "YES"
        stop
    else if(S(1:1) .eq. "k" .and. S(2:2) .ne. "e") then
        if(S(L-5:L) .eq. "eyence") then
            write(*,*) "YES"
            stop
        end if
    else if(S(1:2) .eq. "ke" .and. S(3:3) .ne. "y") then
        if(S(L-4:L) .eq. "yence") then
            write(*,*) "YES"
            stop
        end if
    else if(S(1:3) .eq. "key" .and. S(4:4) .ne. "e") then
        if(S(L-3:L) .eq. "ence") then
            write(*,*) "YES"
            stop
        end if
    else if(S(1:4) .eq. "keye" .and. S(5:5) .ne. "n") then
        if(S(L-2:L) .eq. "nce") then
            write(*,*) "YES"
            stop
        end if
    else if(S(1:5) .eq. "keyen" .and. S(6:6) .ne. "c") then
        if(S(L-1:L) .eq. "ce") then
            write(*,*) "YES"
            stop
        end if
    else if(S(1:6) .eq. "keyenc" .and. S(7:7) .ne. "e") then
        if(S(L:L) .eq. "e") then
            write(*,*) "YES"
            stop
        end if
    end if

    write(*,*) "NO"
    stop
end program prob2