#include // #include // #include using namespace std; // using namespace atcoder; // using bint = boost::multiprecision::cpp_int; using ll = long long; using ull = unsigned long long; using P = pair; #define rep(i,n) for(ll i = 0;i < (ll)n;i++) #define ALL(x) (x).begin(),(x).end() // #define MOD 1000000007 #define MOD 998244353 int main(){ int n,m; string s; cin >> n >> m >> s; deque w,c,a; rep(i,2*(n+m)){ if(s[i] == 'W')w.push_back(i); else if(s[i] == 'A')a.push_back(i); else c.push_back(i); } bool is = true; while(!w.empty()){ if(a.empty()){ is = false; break; } if(w.back() > a.back())is = false; w.pop_back();a.pop_back(); } while(!c.empty()){ if(a.empty()){ is = false; break; } if(c.front() < a.front())is = false; c.pop_front();a.pop_front(); } cout << (is ? "Yes\n" : "No\n"); return 0; }