408287: GYM103076 J Impress your friends
Description
You and your group of friends went to the Café at Area II to have a coffee between classes. As usual the group makes a circle and starts to chat and you want to seize this opportunity to impress your friends! However, the risk of you being embarrassed must be taken into account. In order to do this, you need to know in a timely manner if it is possible to solve a 2x2x2 magic cube within 5 moves, since more than this would make you look like a goofy.
A 2x2x2 cube can be flattened by cutting its edges. The result would look like this:
You'll receive 8 line where each one of them represents a line of the cube printed into a 2D plan.
..NO..
..MP..
..JK..
..IL..
BCFGVW
ADEHUZ
..RS..
..QT..
Replace every letter with a digit between 1 and 6, representing the color. It's guaranteed that each colors appears exactly 4 times.
OutputFor the single test case:
"YES", if you can impress your friends; "NO", otherwise.
You may print every letter in any case you want (so, for example, the strings yEs, yes, Yes and YES are all recognized as positive answer).
ExamplesInput..13.. ..25.. ..46.. ..66.. 145253 342251 ..13.. ..46..Output
NOInput
..33.. ..55.. ..66.. ..66.. 112233 551122 ..44.. ..44..Output
YES