def query(a,b): print(f"{a+1} {b+1}",flush=1) if DEBUG: return a!=1 or b!=1 else: return input() == "Black" DEBUG = 0 n,m = map(int,input().split()) b = [[0]*n for _ in range(n)] b[0][0] = b[-1][-1] = 1 q = [(0,0)] while q: i,j = q.pop() for ni,nj in [(i-1,j),(i,j-1),(i+1,j),(i,j+1)]: if ni == nj == n-1: print("Yes") exit() if 0 <= ni < n and 0 <= nj < n and b[ni][nj] == 0: b[ni][nj] = 1 if query(ni,nj): q.append((ni,nj)) print("No")