Language: C++

#include<iostream>
#include<string>
#include<algorithm>    
#include<cmath>
#include<map>
#include<vector>
#include<math.h>
#include<stdio.h>
#define int long long
using namespace std;
int test[213456], uiop[213456];
signed main() {
	int n = 0, a = 0, b = 0, c = 0, d = 0, e = 0; string s; cin >> s;
	for (int h = 0; h < s.size(); h++) {
		if (s[h] == 'k' && s[h + 1] == 'e' && s[h + 2] == 'y' && s[h + 3] == 'e' && s[h + 4] == 'n' && s[h + 5] == 'c' && s[h + 6] == 'e') {
			if (h == 0 || h + 6 == s.size() - 1) { cout << "YES" << endl; return 0; ; }
		}
		if (s[h] == 'k') { 
			if(h==0)n++; 
		}
		if (s[h] == 'e' && s[h + 1] == 'y' && s[h + 2] == 'e' && s[h + 3] == 'n' && s[h + 4] == 'c' && s[h + 5] == 'e') {
			if (n != 0 && h + 5 == s.size - 1) { cout << "YES" << endl; return 0; }
		}
		if (s[h] == 'k' && s[h + 1] == 'e') { if (h == 0)a++; }
		if (s[h] == 'y' && s[h + 1] == 'e' && s[h + 2] == 'n' && s[h + 3] == 'c' && s[h + 4] == 'e') {
			if (a != 0 && h + 4 == s.size - 1) { cout << "YES" << endl; return 0; }
		}
		if (s[h] == 'k' && s[h + 1] == 'e' && s[h + 2] == 'y') { if (h == 0)b++; }
		if (s[h] == 'e' && s[h + 1] == 'n' && s[h + 2] == 'c' && s[h + 3] == 'e') {
			if (b != 0 && h + 3 == s.size - 1) { cout << "YES" << endl; return 0; }
		}
		if (s[h] == 'k' && s[h + 1] == 'e' && s[h + 2] == 'y' && s[h + 3] == 'e') { if (h == 0)c++; }
		if (s[h] == 'n' && s[h + 1] == 'c' && s[h + 2] == 'e') {
			if (c != 0 && h + 2 == s.size - 1) { cout << "YES" << endl; return 0; }
		}
		if (s[h] == 'k' && s[h + 1] == 'e' && s[h + 2] == 'y' && s[h + 3] == 'e' && s[h + 4] == 'n') { if (h == 0)d++; }
		if (s[h] == 'c' && s[h + 1] == 'e') {
			if (d != 0 && h + 1 == s.size - 1) { cout << "YES" << endl; return 0; }
		}
		if (s[h] == 'k' && s[h + 1] == 'e' && s[h + 2] == 'y' && s[h + 3] == 'e' && s[h + 4] == 'n' && s[h + 5] == 'c') { e++; }
		if (h <= s.size() - 5 && s[h + 5] == 'e') {
			if (e != 0 && h == s.size - 1) { cout << "YES" << endl; return 0; }
		}
	}
	cout << "NO" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:50: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   22 |                         if (n != 0 && h + 5 == s.size - 1) { cout << "YES" << endl; return 0; }
      |                                                ~~^~~~
      |                                                      ()
a.cc:26:50: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   26 |                         if (a != 0 && h + 4 == s.size - 1) { cout << "YES" << endl; return 0; }
      |                                                ~~^~~~
      |                                                      ()
a.cc:30:50: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   30 |                         if (b != 0 && h + 3 == s.size - 1) { cout << "YES" << endl; return 0; }
      |                                                ~~^~~~
      |                                                      ()
a.cc:34:50: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   34 |                         if (c != 0 && h + 2 == s.size - 1) { cout << "YES" << endl; return 0; }
      |                                                ~~^~~~
      |                                                      ()
a.cc:38:50: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   38 |                         if (d != 0 && h + 1 == s.size - 1) { cout << "YES" << endl; return 0; }
      |                                                ~~^~~~
      |                                                      ()
a.cc:42:46: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   42 |                         if (e != 0 && h == s.size - 1) { cout << "YES" << endl; return 0; }
      |                                            ~~^~~~
      |                                                  ()