An enemy army struck King Kangho from a direction he never expected, so Kangho has to redeploy his troops in a hurry. He handed the job to the wizard Minho.
Minho owns three magic towers that teleport an army. Activating one tower moves every soldier to a new place at the same time. The new place is the point symmetric to the old place about that tower. The tower therefore sits at the midpoint of the segment joining a soldier's old place and new place.
Kangho can activate the three towers in any order and as many times as he likes, and he can activate the same tower more than once. He can also activate no tower at all.
You are given the current positions of the soldiers, the positions Kangho wants, and the coordinates of the three magic towers. Write a program that decides whether Kangho can turn the current arrangement into the arrangement he wants.
A soldier cannot move except by teleportation. Soldiers are indistinguishable, so their numbering does not have to be preserved. The soldier standing at the first coordinate of the input may end up at the third coordinate of the desired arrangement.