Multiple cases. The number of cases will not exceed 100.
For each case, the first line contains two integers N (1 ≤ N ≤ 1000) and M (1 ≤ M ≤ 1000), indicating the chessboard’s size. Then following N lines, each line contains M characters, indicating the colors of the corresponding grids. ’w’ means white and ‘b’ means black.
5 5 wwwww wbbbw wbbbw wbbbw wwwww 5 5 wwwww wbbbw wbwbw wbbbw wwwww
Yes No