from collections import deque N,M = map(int,input().split()) #-1: 白確定 0: 不明 1: 黒確定 G = [[0] * (N+1) for _ in range(N+1)] for h in range(N+1): G[h][0] = -1 G[0][h] = -1 G[1][1] = 1 M -= 2 Q = deque([(1,2),(2,1)]) while Q: h,w = Q.popleft() if G[h][w] != 0: continue if h == w == N: print('Yes') exit() if M == 0: continue M -= 1 print(h,w) a = input() G[h][w] = -1 if a == 'White' else 1 if G[h][w] == -1: continue for x,y in[(h-1,w),(h+1,w),(h,w-1),(h,w+1)]: if x in range(1, N+1) and y in range(1, N+1): Q.append((x,y)) print('No')