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) m = 0 while len(q) > 0: r, c = q.popleft() if used[r, c]: continue used[r, c] = True if r == N and c == N: return True if m == 3000: return False black = query(r, c) m += 1 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')