Determine whether a rook on a square with given coordinates (row and column) attacks a piece on another specified square.
Four numbers are entered: the coordinates of the rook (two numbers) and the coordinates of another piece (two numbers), each on a separate line. Coordinates are integers from 1 to 8.
Output "YES" if the rook can capture the piece in one move, otherwise output "NO".
Input #1
1 1 2 2
Output #1
NO
Input #2
1 1 2 1
Output #2
YES
Sign in to submit your solution and save your progress.