def check(S,a,b): k=0 for i in range(len(S)): if S[i]==a: k+=1 elif S[i]==b: k-=1 if k<0: return False return True def solve(): N,M=map(int,input().split()) S=input() return check(S,"A","C") and check(S[::-1], "A","W") #================================================== print("Yes" if solve() else "No")