Олимпиадный тренинг

Задача 38643. Under the control of the rook


It is required to determine whether a rook located on a cell with the specified coordinates (row number and column number) controls a piece located on another specified cell.

Input
Four numbers are entered: the coordinates of the rook (two numbers) and the coordinates of the other piece (two numbers), each number is entered on a separate line. Coordinates are integers in the range from 1 to 8.

Imprint
It is required to print the word YES if the rook can capture the piece in 1 move and NO otherwise.
 
Examples
# Input Output
1 1
1
2
2
NO
2 1
1
2
1
YES