#P12156. Energy Battery Partitioning Problem
Energy Battery Partitioning Problem
Energy Battery Partitioning Problem
Researcher Xiao Lan has been instructed by the laboratory director to perform grouping experiments on the newly developed energy batteries. There are N batteries with energy values given by integers \(A_1, A_2, \dots, A_N\). Xiao Lan needs to divide these batteries into two non-empty groups such that the bitwise XOR sums of the energy values of the two groups are equal.
The XOR sum of a set \(S\) is defined as:
[ \bigoplus_{x \in S} x ]
For example, the XOR sum of \(\{1, 2, 3\}\) is:
[ 1 \oplus 2 \oplus 3 = 0 ]
</p>Help Xiao Lan determine whether such a partition is possible.
inputFormat
The first line of the input contains an integer \(N\) (\(N \ge 1\)) representing the number of batteries.
The second line contains \(N\) integers \(A_1, A_2, \dots, A_N\) separated by spaces.
outputFormat
Output Yes if it is possible to partition the batteries into two non-empty groups with equal XOR sums, otherwise output No.
sample
2
1 1
Yes