N,M = map(int,input().split()) S = input() NS = len(S) a,w,c = 0,0,0 for i in range(NS): s = S[i] if s == "A": a += 1 elif s == "C": c += 1 if a < c: print("No") exit() a,w,c = 0,0,0 for i in reversed(range(NS)): s = S[i] if s == "A": a += 1 elif s == "W": w += 1 if a < w: print("No") exit() print("Yes")