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 C# (Mono 4.6.2.0) (judge verdict: Wrong Answer)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class Program
{
    static void Main(string[] args)
    {
            // 入力
            string sS = System.Console.ReadLine().Trim();

            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
            sw.Start();

            // 解析
            //List<string> lstDel = new List<string>();
            //lstDel.Add("");
            string sOrg = "keyence";
            string sOut = "NO";
            if (sS == sOrg) { sOut = "YES"; }
            else
            {
                for (int i = 0; i < sS.Length; i++)
                {
                    for (int j = 1; j <= sS.Length - i; j++)
                    {
                        //lstDel.Add(sS.Substring(i, j));                               // 全ての連続部分文字列の取得 ←必要なかった
                        string sZan = "";                                               // 全ての連続部分文字列の取得後の残り
                        if (i - 1 <= 0) { sZan = sS.Substring(i + j); }
                        else if (i + j > sS.Length) { sZan = sS.Substring(0, i - 1); }
                        else { sZan = sS.Substring(0, i - 1) + sS.Substring(i + j); }
                        if (sZan == sOrg) { sOut = "YES"; break; }
                    }
                    if (sOut == "YES") { break; }
                }
            }

            // 出力
            System.Console.WriteLine("{0}", sOut.ToString().Trim());

            sw.Stop();
#if DEBUG
            Console.WriteLine();
            Console.WriteLine("{0}", sw.Elapsed.ToString());
            Console.WriteLine("続行するには何かキーを押してください．．．");
            Console.ReadKey();
#endif
    }

}