def question(a,b): print(a,b,flush=True) ans=input() if ans[0]=="B": return 1 elif ans[0]=="W": return 0 else: exit() def answer(ans): exit(print(ans,flush=True)) #================================================= from collections import deque N,M=map(int,input().split()) # 自明な否定 if 2*N-1>M: answer("No") X=[[-1]*(N+1) for _ in range(N+1)] X[1][1]=X[N][N]=1 Remain=M-2 Q=deque([(1,1)]) T=[(1,0),(-1,0),(0,1),(0,-1)] while Q: x,y=Q.popleft() if Remain==0: break if x==y==N: break for a,b in T: p=x+a; q=y+b if 1<=p<=N and 1<=q<=N and X[p][q]==-1 and (N-p)+(N-q)<=Remain: X[p][q]=quest=question(p,q) if quest: Q.append((p,q)) Remain-=1 answer("Yes" if X[N][N]==1 else "No")