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 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: if (N-p)+(N-q)==1: break Q.append((p,q)) Remain-=1 F=[[0]*(N+1) for _ in range(N+1)]; F[1][1]=1 Q=deque([(1,1)]) while Q: x,y=Q.popleft() 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 F[p][q]==0: F[p][q]=1 Q.append((p,q)) answer("Yes" if F[N][N] else "No")