Scanf.scanf "%s" (fun s ->
    let k = "keyence" in
    let n = String.length s in
    let judge a =
        String.sub s 0           a       = String.sub k 0 a &&
        String.sub s (n - 7 + a) (7 - a) = String.sub k a (7 - a)
    in
    let rec loop i =
        if i < 0 then "NO" else
            if judge i then "YES" else
                loop (i - 1)
    in
    loop 7 |> print_endline
)
