n, m = map(int,input().split()) s = input() assert 1 <= n <= 10 ** 5 assert 1 <= m <= 10 ** 5 w = s.count("W") a = s.count("A") c = s.count("C") assert w == n assert a == n + m assert c == m assert len(s) == 2*(n+m) pivot = 0 for i in range(2*(n+m)): if s[i] == "C": mode = 0 while pivot < i and mode == 0: if s[pivot] == "A": mode = 1 pivot += 1 if mode == 0: print("No") exit() for i in range(2*(n+m)): if s[i] == "W": mode = 0 while pivot < 2*(n+m) and mode == 0: if s[pivot] == "A": mode = 1 pivot += 1 if mode == 0: print("No") exit() print("Yes")