Given a rectangular field composed of free and occupied cells, your task is to determine if it is possible to travel from cell A to cell C, passing through cell B. Movement is allowed only between adjacent free cells. You cannot move outside the field, pass through occupied cells, or visit any cell more than once.
The input begins with two integers, and (1 \leq R, C \leq 100), which represent the dimensions of the field. This is followed by rows, each containing characters, describing the cells. Each cell is represented by one of the following: '.' for a free cell, '#' for an occupied cell, or one of the checkpoints 'A', 'B', or 'C'. Each of the symbols 'A', 'B', and 'C' appears exactly once in the field description.
Output "Yes" if a valid path exists from A to C via B. Otherwise, output "No".
1-nji mysal