Rectangular Field
Given a rectangular field composed of free and occupied cells, your task is to determine if it's possible to travel from cell A to cell C, passing through cell B. Movement is allowed only between adjacent free cells, and you cannot move outside the field, pass through occupied cells, or visit any cell more than once.
Input
The input begins with two integers, R and C (1 ≤ R, C ≤ 100), which represent the dimensions of the field. This is followed by R rows, each containing C 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
Output "Yes" if a valid path exists from A to C via B. Otherwise, output "No".