#include using i64 = long long; int main() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); int N, M; std::cin >> N >> M; std::string S; std::cin >> S; std::vector pW, pA, pC; for (int i = 0; i < 2 * (N + M); i++) { if (S[i] == 'W') { pW.push_back(i); } else if (S[i] == 'A') { pA.push_back(i); } else { pC.push_back(i); } } for (int i = 0; i < N; i++) { if (pW[i] > pA[M + i]) { std::cout << "No\n"; return 0; } } for (int i = 0; i < M; i++) { if (pA[i] > pC[i]) { std::cout << "No\n"; return 0; } } std::cout << "Yes\n"; return 0; }