In chess, rooks are able to move in a horizontal direction or in a vertical one. In one move, they can get to any other location on the board until reaching an obstacle or the end of the board. If there is another figure on the path, the rook hits the figure.
Having two rooks, we would like to know if they hit each other. Given the r1 (row) and c1 (column) coordinates of the first rook, and r2 (row) and c2 (column) coordinates of the second rook, print Yes if they hit each other, and No otherwise.