Ehab is known for his adoration for a specific activity. He has a cluster an of length n, and he chose to continue doing the accompanying procedure on it: he picks 2 neighboring components; he then, at that point, eliminates them and spots a solitary integer in their place: their bitwise
Correct answer will be upvoted else downvoted.
Child Ehab is known for his adoration for a specific activity. He has a cluster an of length n, and he chose to continue doing the accompanying procedure on it:
he picks 2 neighboring components; he then, at that point, eliminates them and spots a solitary integer in their place: their bitwise XOR. Note that the length of the exhibit diminishes by one.
Presently he inquires as to whether he can make all components of the exhibit equivalent. Since infants like to make your life harder, he necessitates that you leave no less than 2 components remaining.
Input
The principal line contains an integer t (1≤t≤15) — the number of experiments you really wanted to tackle.
The principal line of each experiment contains an integers n (2≤n≤2000) — the number of components in the exhibit a.
The subsequent line contains n space-isolated integers a1, a2, … , an (0≤
Output
On the off chance that Baby Ehab can make all components equivalent while leaving no less than 2 components standing, print "YES". In any case, print "NO".
Step by step
Solved in 3 steps with 1 images