from functools import reduce

from collections import Counter





N = int(eval(input()))

a = list(map(int, input().split()))

if N % 3 and a != [0] * N:

    print("No")

    exit()



nums = Counter(a)

ks = sorted(nums)

vs = sorted(nums.values())

if (

    (len(nums) == 1 and ks[0] == 0)

    or (len(nums) == 2 and ks[0] == 0 and vs[0] == N // 3)

    or (

        len(nums) == 3

        and all(v == N // 3 for v in vs)

        and reduce(lambda x, y: x ^ y, ks) == 0

    )

):

    print("Yes")

else:

    print("No")

N, *A = map(int, open(0).read().split())

A_set = set(A)



if len(A_set) == 1:

    print("Yes") if sum(A) == 0 else print("No")

elif len(A_set) == 2:

    a1, a2 = sorted(A_set)

    print("Yes") if a1 == 0 and A.count(a1) * 3 == N else print("No")

elif len(A_set) == 3:

    a1, a2, a3 = list(A_set)

    if a1 ^ a2 ^ a3 == 0 and A.count(a1) == A.count(a2) == A.count(a3):

        print("Yes")

    else:

        print("No")

else:

    print("No")

from functools import reduce
from collections import Counter

N = int(eval(input()))
a = list(map(int, input().split()))
if N % 3 and a != [0] * N:
    print("No")
    exit()
nums = Counter(a)
ks = sorted(nums)
vs = sorted(nums.values())
if (
    (len(nums) == 1 and ks[0] == 0)
    or (len(nums) == 2 and ks[0] == 0 and vs[0] == N // 3)
    or (
        len(nums) == 3
        and all(v == N // 3 for v in vs)
        and reduce(lambda x, y: x ^ y, ks) == 0
    )
):
    print("Yes")
else:
    print("No")

N, *A = map(int, open(0).read().split())
A_set = set(A)
if len(A_set) == 1:
    print("Yes") if sum(A) == 0 else print("No")
elif len(A_set) == 2:
    a1, a2 = sorted(A_set)
    print("Yes") if a1 == 0 and A.count(a1) * 3 == N else print("No")
elif len(A_set) == 3:
    a1, a2, a3 = list(A_set)
    if a1 ^ a2 ^ a3 == 0 and A.count(a1) == A.count(a2) == A.count(a3):
        print("Yes")
    else:
        print("No")
else:
    print("No")

-from functools import reduce -from collections import Counter - -N = int(eval(input())) -a = list(map(int, input().split())) -if N % 3 and a != [0] * N: -    print("No") -    exit() -nums = Counter(a) -ks = sorted(nums) -vs = sorted(nums.values()) -if ( -    (len(nums) == 1 and ks[0] == 0) -    or (len(nums) == 2 and ks[0] == 0 and vs[0] == N // 3) -    or ( -        len(nums) == 3 -        and all(v == N // 3 for v in vs) -        and reduce(lambda x, y: x ^ y, ks) == 0 -    ) -): -    print("Yes") +N, *A = map(int, open(0).read().split()) +A_set = set(A) +if len(A_set) == 1: +    print("Yes") if sum(A) == 0 else print("No") +elif len(A_set) == 2: +    a1, a2 = sorted(A_set) +    print("Yes") if a1 == 0 and A.count(a1) * 3 == N else print("No") +elif len(A_set) == 3: +    a1, a2, a3 = list(A_set) +    if a1 ^ a2 ^ a3 == 0 and A.count(a1) == A.count(a2) == A.count(a3): +        print("Yes") +    else: +        print("No")