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 as it was. Upon returning, you see the same game and the board . Can you tell if it is possible to obtain board from board in no more than one move, made according to the rules?
Please note that the first move is made by the player placing the . Also, the standard rule that the game stops if there are three X's or O's in a row does not apply here.
输入格式
The first three lines contain three symbols each, describing the initial board.
The next three lines contain three symbols each, describing the final board.
Each cell of the board is described by three symbols:
--- denotes an empty cell;
--- denotes a placed O;
--- denotes a placed X.
It is guaranteed that board A can be obtained by a sequence of valid moves from an empty board.
输出格式
Output or (in any case) depending on whether it was possible to obtain board from board .
样例
样例输入 1
.X.
.X.
00.
.X.
.X.
000
样例输出 1
NO
样例输入 2
.XX
.00
...
XXX
.00
...
样例输出 2
YES
样例输入 3
XXX
000
...
XXX
000
.X.
样例输出 3
YES
样例输入 4
0X0
X.X
0X0
X0X
0.0
X0X
样例输出 4
NO
样例输入 5
.X.
...
...
.X.
...
...
样例输出 5
YES
数据范围与提示
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.