from collections import deque N, M = map(int, input().split()) d = deque([(0, 0)]) table = [[None] * N for _ in range(N)] table[0][0] = True def query(x, y): print(x, y, flush=True) T = input() if T == 'Black': return True elif T == 'White': return False else: raise ValueError while d: x, y = d.pop() if x == N - 1 and y == N - 1: print('Yes', flush=True) exit() for dx, dy in ((1, 0), (0, 1), (-1, 0), (0, -1)): xdx, ydy = x + dx, y + dy if 0 <= xdx < N and 0 <= ydy < N and table[xdx][ydy] is None: T = query(xdx + 1, ydy + 1) table[xdx][ydy] = T if T: d.append((xdx, ydy)) print('No', flush=True)