import sys input = lambda : sys.stdin.readline().rstrip() sys.setrecursionlimit(2*10**5+10) write = lambda x: sys.stdout.write(x+"\n") debug = lambda x: sys.stderr.write(x+"\n") writef = lambda x: print("{:.12f}".format(x)) def answer(i, val): write(val) sys.stdout.flush() # write(f"Case #{i+1}: {val}") # 標準出力による質問 interactive import sys # _l = [2,4,3,1,5,7,6] # ans = list(range(len(_l))) # ans.sort(key=lambda i: _l[i]) # ans = [ans[i] for i in range(len(ans))] # def q(i,j,k): # v = sorted([i,j,k], key=lambda i: _l[i]) # return v[1] def query(x,y): print(x+1,y+1) sys.stdout.flush() res = input() if res=="Black": return 1 elif res=="White": return 0 assert 0 def sub(x,y): if done[x][y]: return global count count += 1 res = query(x,y) if res: q.append((x,y)) done[x][y] = 1 if __name__=="__main__": count = 0 val = input() n,m = map(int, val.split()) done = [[0]*n for _ in range(n)] q = [(0,0)] done[0][0] = 1 while q: x,y = q.pop() if x==y==n-1: print("Yes") break if x+1=3000: break if x-1>=0: sub(x-1,y) if count>=3000: break if y+1=3000: break if y-1>=n: sub(x,y-1) if count>=3000: break if (n-1,n-1) in q: print("Yes") else: print("No")