#include using namespace std; using ll = long long int; using ld = long double; const ll MAX = 5000000000000000000; const ld PI = 3.14159265358979; const ll MOD = 0;//2024948111; random_device rd; mt19937 mt(rd()); ld dotorad(ld K){return PI * K / 180.0;} ld radtodo(ld K){return K * 180.0 / PI;} vector> G(600,vector(600,-1)); void tell(ll x,ll y){ if(G[x][y] != -1) return; string a; cout << x + 1 << " " << y + 1 << endl; cin >> a; G[x][y] = (a == "Black"); } int main(){ ll N,M; cin >> N >> M; queue> que; que.push(make_tuple(0,0)); while(!que.empty()){ ll a = get<0>(que.front()); ll b = get<1>(que.front()); que.pop(); if(a == N - 1 && b == N - 1){ cout << "Yes" << endl; return 0; } if(0 <= a && a < N && 0 <= b && b < N && G[a][b] == -1){ tell(a,b); if(G[a][b]){ que.push(make_tuple(a + 1,b)); que.push(make_tuple(a - 1,b)); que.push(make_tuple(a,b + 1)); que.push(make_tuple(a,b - 1)); } } } cout << "No" << endl; }