#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); long long N, M; if (!(cin >> N >> M)) return 0; string s; cin >> s; long long w = 0, a = 0, wa = 0, ac = 0; for (char c : s) { if (c == 'W') w++; else if (c == 'A') { if (w > 0) { w--; wa++; } else a++; } else if (c == 'C') { if (a > 0) { a--; ac++; } else { cout << "NO\n"; return 0; } } } if (wa == N && ac == M && w == 0 && a == 0) cout << "YES\n"; else cout << "NO\n"; return 0; }