n, m = map(int, input().split()) s = input() w = [] a = [] c = [] for i in range((n + m) * 2): if s[i] == 'W': w.append(i) elif s[i] == 'A': a.append(i) else: c.append(i) for i in range(n): if w[i] > a[i + n]: print('No') exit(0) for i in range(m): if a[i] > c[i]: print('No') exit(0) print('Yes')