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 Go (1.6) (judge verdict: Wrong Answer)

// by syu
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"strings"
)

var in = NewScanner(os.Stdin, 0)

func main() {
	s := in.String()
	switch {
	case check(s, "k", "eyence"):
		fallthrough
	case check(s, "ke", "yence"):
		fallthrough
	case check(s, "key", "ence"):
		fallthrough
	case check(s, "keye", "nce"):
		fallthrough
	case check(s, "keyen", "ce"):
		fallthrough
	case check(s, "keyenc", "e"):
		fallthrough
	case check(s, "keyence", ""):
		Rln("YES")
	default:
		Rln("NO")
	}
}
func check(a, x, y string) bool {
	f1 := strings.Index(a, x)
	if f1 < 0 {
		return false
	}
	f2 := strings.Index(a[f1+len(x)-1:], y)
	if f2 < 0 {
		return false
	}
	return true
}

type Scanner struct {
	*bufio.Scanner
}

func NewScanner(r io.Reader, max int) *Scanner {
	s := bufio.NewScanner(r)
	s.Split(scanWords)
	if max <= 0 {
		max = 1048576
	}
	s.Buffer([]byte{}, max)
	return &Scanner{s}
}
func (s *Scanner) String() string {
	s.Scan()
	return s.Text()
}
func isSpace(b byte) bool {
	return b == ' ' || b == '\n' || b == '\r' || b == '\t'
}
func scanWords(data []byte, atEOF bool) (advance int, token []byte, err error) {
	start := 0
	for start < len(data) && isSpace(data[start]) {
		start++
	}
	for i := start; i < len(data); i++ {
		if isSpace(data[i]) {
			return i + 1, data[start:i], nil
		}
	}
	if atEOF && len(data) > start {
		return len(data), data[start:], nil
	}
	return start, nil, nil
}
func Rln(s ...interface{}) {
	fmt.Println(s...)
	os.Exit(0)
}

type ByteSlice []byte
type IntSlice []byte