Enchanted Mirror

Time limit3sMemory limit256 MB

Problem

Alice loves two things in this world: her mirror and her alphabet toy bricks. Each brick has a single letter printed on its top face.

The mirror is enchanted, so a brick seen in the mirror may show a different letter than the one on its real face. In other words, every brick carries two fixed letters: the letter it shows in the real world and the letter it shows in the mirror.

Alice lays N bricks in a row. Read from left to right, the row spells the word S1 in the real world. In the mirror the same row appears left-right reversed and spells the word S2, which may differ from a plain reflection of S1 because the mirror is enchanted. Both words have length N. Because the mirror reverses the order, the brick at real position i appears at mirror position N - i + 1.

Alice may repeat the following move any number of times: she picks two positions i and j and swaps the two bricks in the real row. Since the same physical bricks move, the mirror image performs the matching swap of positions N - i + 1 and N - j + 1 automatically.

Alice wants the real row to spell T1 while the mirror simultaneously spells T2. Determine whether she can reach this goal.

Input

Four lines, each containing one word, given in the order S1, S2, T1, T2. Every word has the same length N (1 ≤ N ≤ 100) and consists only of uppercase English letters (A–Z).

Output

Print Yes if Alice can make the real row spell T1 while the mirror spells T2 at the same time; otherwise print No.