Tura
Execution time limit is 1 second
Runtime memory usage limit is 122.174 megabytes
You need to determine if a rook, positioned on a cell with specific coordinates (row and column numbers), can attack another piece located on a different cell.
Input
You will be given four numbers: the coordinates of the rook (two numbers) and the coordinates of the other piece (two numbers). Each number is provided on a separate line.
Vasya, the boy who created this puzzle, hasn't learned chess notation yet. Therefore, he describes the positions of the pieces using his own system, which resembles the way points are positioned in the 1st quadrant of a coordinate plane rather than traditional chess notation.
Output
Print "YES" if the rook can attack the piece; otherwise, print "NO".
Examples
Input #1
Answer #1
Input #2
Answer #2
Submissions 4K
Acceptance rate 52%