Tic-Tac-Toe
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

You were playing tic-tac-toe with a friend online. However, there was a problem, another air raid in your area! Being a responsible person, you go to the bomb shelter. After the alarm is over, you come back to finish the game, but something is not right. Your friend may have cheated and changed the board.

You remember the game board $$$A$$$ as it was. Upon returning, you see the same game and the board $$$B$$$. Can you tell if it is possible to obtain board $$$B$$$ from board $$$A$$$ in no more than one move, made according to the rules?

Please note that the first move is made by the player placing the X. Also, the standard rule that the game stops if there are three X's or O's in a row does not apply here.

Input

The first three lines contain three symbols $$$A_{i, j}$$$ each, describing the initial board.

The next three lines contain three symbols $$$B_{i, j}$$$ each, describing the final board.

Each cell of the board is described by three symbols:

- "." — denotes an empty cell;
- "0" — denotes a placed O;
- "X" — denotes a placed X.

It is guaranteed that board A can be obtained by a sequence of valid moves from an empty board.

Output

Output "YES" or "NO" (in any case) depending on whether it was possible to obtain board $$$B$$$ from board $$$A$$$.

Examples

Input

    .X..X.00..X..X.000

Output

    NO

Input

    .XX.00...XXX.00...

Output

    YES

Input

    XXX000...XXX000.X.

Output

    YES

Input

    0X0X.X0X0X0X0.0X0X

Output

    NO

Input

    .X........X.......

Output

    YES

Note

In the first example, one O is added, but it is now the turn to place an X.

In the second example, one X is added.

In the third example, one X is also added. Note that despite having three O's (and X's) in a row, the game does not stop.

In the fourth example, the board is altered.

In the fifth example, no moves were made.