import collections N, M = map(int, input().split()) def query(r, c) -> bool: print(r, c) res = input() if res == '-1': exit() return res == 'Black' def calc(): q = collections.deque() q.append((1, 1)) used = collections.defaultdict(bool) while len(q) > 0: r, c = q.popleft() if used[r, c]: continue if r == N and c == N: return True black = query(r, c) if not black: continue for dr, dc in [(-1, 0), (1, 0), (0, -1), (0, 1)]: if not (1 <= r + dr <= N): continue if not (1 <= c + dc <= N): continue q.append((r + dr, c + dc)) ans = calc() if ans: print('Yes') else: print('No')