#include // #include // NOTE: AtCoderライブラリ #define fi first #define se second #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define dbg(x) cerr << #x << ": " << x << endl; #define dbg2(x, y) cerr << #x << ": " << x << ", " << #y << ": " << y << endl; #define dbg3(x, y, z) cerr << #x << ": " << x << ", " << #y << ": " << y << ", " << #z << ": " << z << endl; #define nl() cout << "========================================" << endl; using namespace std; // using namespace atcoder; // NOTE: AtCoderライブラリ typedef long long ll; typedef long double ld; typedef vector vi; typedef vector> vvi; typedef vector vl; typedef vector> vvl; typedef vector vb; typedef vector vc; typedef vector vs; typedef pair pii; typedef pair pll; const long long LINF = 1001002003004005006ll; const int INF = 1001001001; template void chmin(T &a, T b) { if (a > b) a = b; } template void chmax(T &a, T b) { if (a < b) a = b; } #define yn { puts("Yes"); } else{ puts("No"); } // 使い方: if (条件) yn; int main() { string S; cin >> S; string T = "kadomatsu"; int N = S.size(), M = T.size(); vvi dp(N + 1, vi(M + 1, 0)); rep(i, N) { rep(j, M) { if (S[i] == T[j]) { chmax(dp[i + 1][j + 1], dp[i][j] + 1); } else { chmax(dp[i + 1][j + 1], dp[i + 1][j]); chmax(dp[i + 1][j + 1], dp[i][j + 1]); } } } if (dp[N][M] == N) yn; }