#37Medium
Knight move
Time: 1 s · Memory: 256 MB
- Conditionals
Statement
The files and ranks of a chessboard are numbered from to . A knight stands on square . Can it reach square in one move?
A knight moves in an "L" shape: squares in one direction and square in the perpendicular direction.
Input format
A single line with four integers , , , ().
Output format
YES if it can, NO otherwise.
Examples
Input
1 1 2 3
Output
YES
Input
1 1 3 3
Output
NO
Note
Compute the differences and : for a knight move one of them is and the other is . Staying on the same square is not a move.
