#P11105. [2016杭电多校]Cube again

[2016杭电多校]Cube again

Cube again

Problem Description

Given the state of two 2*2 magic cube, you need to find out whether they are isomorphism or not. Isomorphism means that one cube can be the same with the other one after rotating the whole cube, specular reflection and swapping all the same color on the cube with another color.

Input

There are no more than 10000 test case end with EOF. Each case contains 16 lines. First 8 lines describe the state of the first cube, and the next 8 line describe the other one. A state is given as the format in the picture above. Number from 1 to 6 means the colors. All states are ensured legal.

Output

If the two cube are isomorphism, print "yes", otherwise print "no", without quotes.

Sample Input

11
11
223344
223344
55
55
66
66
22
22
113355
113355
44
44
66
66
11
11
223344
223344
55
55
66
66
22
22
113344
113344
55
55
66
66
11
11
223344
223344
55
55
66
66
13
13
223544
223544
56
56
61
61

Sample Output

yes
yes
no

Author

BUPT

Source

2016 Multi-University Training Contest 10