import sys, math sys.set_int_max_str_digits(0) N, M = map(int, input().split()) S = input() # AC を貪欲に消す stack = [] for s in S: if stack and stack[-1] == 'A' and s == 'C': stack.pop() else: stack.append(s) # WA を貪欲に消す stack2 = [] for s in stack: if stack2 and stack2[-1] == 'W' and s == 'A': stack2.pop() else: stack2.append(s) if stack2: print('No') else: print('Yes')