#include using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); long long N, M; string S; if(!(cin >> N >> M >> S)) return 0; long long needWA = N, needAC = M; long long w_avail = 0, a_avail = 0; for(char ch : S){ if(ch == 'W'){ w_avail++; } else if(ch == 'A'){ if(needWA > 0 && w_avail > 0){ // form WA using one available W and this A needWA--; w_avail--; } else { // keep this A for potential AC a_avail++; } } else if(ch == 'C'){ if(needAC > 0 && a_avail > 0){ // form AC using one earlier A and this C needAC--; a_avail--; } else { cout << "No\n"; return 0; } } else { // unexpected char, ignore or fail } } if(needWA == 0 && needAC == 0) cout << "Yes\n"; else cout << "No\n"; return 0; }