There are people standing at positions , where is even. Each person must belong to exactly one pair.
You are given an array . Person reports that the distance between their position and their partner's position is . The distance between positions and is .
Determine whether the people can be divided into pairs so that every report is correct.
Output Yes if it is possible, and No otherwise. The case of the letters is ignored.
Pair positions and .
Pair positions and .
Position must be paired with position , and position with position . The remaining positions cannot be paired with each other.
Person must be paired with person , but their reports disagree.
Pair positions , , and .