import sys sys.setrecursionlimit(200050) N, M = map(int, input().split()) N2 = (N + M) * 2 S = input() Q = [] def dfs(x): if x == N2: if Q: return else: print("Yes") exit() if Q: if Q[-1] == "W" and S[x] == "A": tmp = Q.pop(-1) dfs(x + 1) Q.append(tmp) elif Q[-1] == "A" and S[x] == "C": tmp = Q.pop(-1) dfs(x + 1) Q.append(tmp) Q.append(S[x]) dfs(x + 1) Q.pop(-1) dfs(0) print("No")