#include <bits/stdc++.h>
using namespace std;
bool prime[500010];
void SieveOfEratosthenes(long long n) {
  memset(prime, true, sizeof(prime));
  for (long long p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (long long i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
}
long long power(long long x, long long y) {
  if (y == 0)
    return 1;
  else if (y % 2 == 0)
    return power(x, y / 2) * power(x, y / 2);
  else
    return x * power(x, y / 2) * power(x, y / 2);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  cin >> s;
  long long c = -1;
  vector<long long> v;
  string a = "keyence";
  long long c1 = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == a[i] && i < 7) {
      c1++;
    } else {
      break;
    }
  }
  long long c2 = 0, j = 6;
  for (long long i = s.size() - 1; i >= 0; i--) {
    if (s[i] == a[j] && j >= 0) {
      c2++;
      j--;
    } else {
      break;
    }
  }
  cout << c1 << " " << c2 << endl;
  if (c1 + c2 >= 7)
    cout << "YES";
  else {
    cout << "NO";
  }
}
