program name
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int32):: i, j, ans
    character(7):: keyence = 'keyence'
    character(100):: s
    logical:: tvs

    read*, s
    j=1
    tvs=.false.
    ans=0
    do i=1,len_trim(s)
        if (s(i:i) == keyence(j:j)) then
            j=j+1
            tvs=.false.
        else
            if (.not. tvs) ans=ans+1
            tvs=.true.
        end if
    end do

    if (ans <= 1 .and. j==8) then
        print*, 'YES'
    else
        print*, 'NO'
    end if

end program name