#include <bits/stdc++.h>
int main(void) {
  int i, l = 0, ha = 0, ta = 0;
  char s[101], h[8] = "keyence";
  scanf("%s", s);
  while (s[l]) l++;
  for (i = 0; i < 7; i++) {
    if (s[i] != h[i]) break;
    ha++;
  }
  for (i = 0; i < 7; i++) {
    if (s[l - 1 - i] != h[6 - i]) break;
    ta++;
  }
  printf("%d %d\n%s\n", ha, ta, (ha + ta >= 7) ? "YES" : "NO");
  return 0;
}
