Problem E. Enchanted Mirror

Author:ACM ICPC 2008-2009, NEERC, Northern Subregional Contest   Time limit:3 sec
Input file:enchanted.in   Memory limit:256 Mb
Output file:enchanted.out  

Statement

Alice likes two things in this world — her mirror and her toy bricks. Alice's toy bricks were designed to help the children to learn the alphabet, so there are some letters written on their top faces. Alice likes to play with the bricks near the mirror.

When Alice learned the alphabet, she noticed that something was wrong with her mirror! A brick in the mirror can show a different letter on it. Alice enjoyed this thing very much, and she invented a new game, trying to make some funny words from the bricks in the real world and in the mirror simultaneously.

The rules of this game are the following. Alice creates a line from some bricks that shows the word S1. This line is shown in the mirror as some word S2, which may be different from the reflection of S1 because the mirror is enchanted. But the length of each of these words is equal to the same integer number N.

Then Alice can repeat the following step. She selects some two bricks i and j and swaps them. The reflected Alice in the mirror does exactly the same with the mirrored line, except that she of course swaps the bricks with positions N − i + 1 and N − j + 1 in it.

The goal is to create word T1 in the real world simultaneously with the word T2 in the mirror. Alice wonders whether it is possible and she asks you for help. Write a program which can determine whether the goal can be achieved.

Input file format

The input file contains four words S1, S2, T1 and T2, in this order, each on the separate line. All words have the same length N and consist only of uppercase English letters.

Output file format

If the goal can be achieved, output "Yes". Otherwise output "No".

Constraints

1 ≤ N ≤ 100.

Sample tests

No. Input file (enchanted.in) Output file (enchanted.out)
1
TEAM
TIED
MATE
EDIT
Yes
2
TEAM
MATE
TAME
MEAT
No
3
AAAA
AAAA
AAAA
AAAA
Yes

0.122s 0.014s 13