#C2768. Karma Sequence

    ID: 46120 Type: Default 1000ms 256MiB

Karma Sequence

Karma Sequence

A sequence is called a karma sequence if its elements can be rearranged so that the bitwise XOR of all the elements equals 0. In mathematical terms, a sequence (S = [S_1, S_2, \ldots, S_N]) is a karma sequence if

[ S_1 \oplus S_2 \oplus \cdots \oplus S_N = 0 ]

where (\oplus) represents the bitwise XOR operation. Given an integer (N) and a list of (N) non-negative integers, your task is to determine whether the sequence can be rearranged into a karma sequence. Note that the XOR operation is commutative, so the order of elements does not affect the final XOR value.

inputFormat

Input is given via standard input (stdin). The first line contains a single integer (N) denoting the number of elements in the sequence. The second line contains (N) non-negative integers separated by spaces representing the sequence.

outputFormat

Output a single line to standard output (stdout) containing "Yes" if the sequence can be rearranged into a karma sequence, or "No" otherwise.## sample

4
1 2 3 0
Yes