Solitaire is a game played on a chessboard 8x8. The rows and columns of the chessboard are numbered from 1 to 8, from the top to the bottom and from left to right respectively.
There are four identical pieces on the board. In one move it is allowed to:
There are 4 moves allowed for each piece in the configuration shown above.
As an example let's consider a piece placed in the row 4, column 4. It can
be moved one row up, two rows down, one column left or two columns right.
Problem
Write a program that:
Each of two input lines contains 8 integers
The output should contain one word YES
if a configuration described in the second input line is reachable
from the configuration described in the first input line in at most
8 moves, or one word NO otherwise.
Output
Sample Input
4 4 4 5 5 4 6 5
2 4 3 3 3 6 4 6
Sample Output
YES