White pawn move. A white chess pawn moves vertically upwards one square at a time. However, if the pawn is on row #2, it has the option to move either one or two squares upwards. Additionally, a white chess pawn can capture an opponent’s piece by moving diagonally upwards one square to the left or right. Note that a white chess pawn can never be located on row #1.
The program will receive four integers between 1 and 8. The first two integers specify the column and row of the starting square, while the last two integers specify the column and row of the target square. The program should print “YES” if the white pawn can legally move from the starting square to the target square in one move, either by a regular move or a capture. Otherwise, the program should print “NO”.
Input |
Output |
1 |
YES |
4 |
YES |
6 |
YES |