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