#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int n = (int)s.size();
  string t = "keyence";
  int cntS = 0;
  while (cntS < 7 && s[cntS] == t[cntS]) ++cntS;
  int cntE = 0;
  while (cntE < 7 && s[n - 1 - cntE] == t[6 - cntE]) ++cntE;
  cout << cntS << ' ' << cntE << '\n';
  if (cntS + cntE >= 7)
    cout << "YES";
  else
    cout << "NO";
}
