#include <bits/stdc++.h>
int main() {
  std::string str;
  std::cin >> str;
  std::string keyence = "keyence";
  int lidx = 0;
  int ridx = 6;
  for (int i = 0; i < str.size(); ++i) {
    if (str[i] == keyence[lidx])
      ++lidx;
    else
      break;
  }
  for (int i = str.size() - 1; i >= 0; --i) {
    if (str[i] == keyence[ridx])
      --ridx;
    else
      break;
  }
  std::cout << lidx << ridx << std::endl;
  if (lidx > ridx)
    std::cout << "YES" << std::endl;
  else
    std::cout << "NO" << std::endl;
}
