n, m = map(int, input().split()) S = input() if S[0] == 'C' or S[-1] == 'W': print('No') else: print('Yes')