n,m = map(int,input().split()) s = input() t=s s=s.replace("AC","");s=s.replace("WA",""); t=t.replace("WA","");t=t.replace("AC",""); if(s==s[::-1] or t==t[::-1]): print("Yes") else: print("No")