import sys flush = sys.stdout.flush N, M = map(int, input().split()) # Black: 1 # White: 0 # unknown: -1 memo = [[-1] * (N + 2) for _ in range(N + 2)] for i in range(N + 2): memo[i][0] = 0 memo[i][-1] = 0 memo[0][i] = 0 memo[-1][i] = 0 memo[1][1] = 1 memo[N][N] = 1 def ask(i, j): if memo[i][j] != -1: return memo[i][j] print(f"{i} {j}") T = input() if T == "Black": memo[i][j] = 1 return 1 elif T == "White": memo[i][j] = 0 return 0 else: exit(-1) stack = [(1, 1)] visited = [[False] * (N + 2) for _ in range(N + 2)] while stack: x, y = stack.pop() if ask(x, y) == 0 or visited[x][y]: continue visited[x][y] = True if x == y == N: print("Yes") exit(0) for dx, dy in zip((-1, 0, 1, 0), (0, 1, 0, -1)): nx = x + dx ny = y + dy stack.append((nx, ny)) # print(stack) print("No")