#define _USE_MATH_DEFINES #include //cin, cout #include //vector #include //sort,min,max,count #include //string,getline, to_string #include //fixed #include //setprecision #include //swap, pair #include //abs(int) #include //sqrt,ceil,M_PI, pow, sin #include //stringstream, getline #include //gcd, accumlate #include //deque #include //randam_device #include //numeric_limits using namespace std; constexpr long long int D_MOD = 1000000007; int main() { string S; cin >> S; if (S.length() < 8) { cout << "No" << endl; return 0; } if (S.find("kadomatsu") != string::npos) { cout << "Yes" << endl; return 0; } string tage = "kadomatsu"; string temp = S; string luck; for (unsigned int i = 0; i < tage.length(); i++) { if (temp.find(tage[i]) == string::npos) { luck.push_back(tage[i]); } else { if (tage[i] == 'a') { temp[temp.find(tage[i])] = '0'; } } } if (luck.length() != 1) { cout << "No" << endl; return 0; } temp = S; for (unsigned int i = 0; i < S.length(); i++) { temp.insert(temp.begin() + i, luck[0]); if (temp.find("kadomatsu") != string::npos) { cout << "Yes" << endl; return 0; } else { temp = S; } } S.push_back(luck[0]); if (S.find("kadomatsu") != string::npos) { cout << "Yes" << endl; } else { cout << "No" << endl; } return 0; }