from collections import Counter

n = int(eval(input()))

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

a_counter = Counter(a)

a_counter_li = list(a_counter)

if sum(a) == 0:

    print("Yes")

elif len(a)%3 != 0:

    print("No")

elif len(a_counter) > 3 or len(a_counter) <= 1:

    print("No")

elif len(a_counter) == 3:

    if a_counter[a_counter_li[0]] == n // 3 and a_counter[a_counter_li[1]] == n // 3 and a_counter[a_counter_li[2]] == n // 3:

        if a_counter_li[0]^a_counter_li[1]^a_counter_li[2] == 0:

            print("Yes")

        else:

            print('No')

    else:

        print("No")

else:

    a_counter_li.sort()

    if a_counter_li[0] == 0 and a_counter[a_counter_li[0]] == n // 3:

        print("Yes")

    else:

        print("No")
from collections import Counter

n = int(eval(input()))

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

a_counter = Counter(a)

k = list(a_counter.keys())

v = list(a_counter.values())



if len(a_counter) == 3 and k[0]^k[1]^k[2] == 0 and v[0] == v[1] == v[2]:

    print("Yes")

elif len(a_counter) == 2 and 0 in k and (v[0] == v[1]*2 or v[1] == v[0]*2):

    print("Yes")

elif len(a_counter) == 1 and 0 in k:

    print("Yes")

else:

    print("No")
from collections import Counter

n = int(eval(input()))
a = list(map(int, input().split()))
a_counter = Counter(a)
a_counter_li = list(a_counter)
if sum(a) == 0:
    print("Yes")
elif len(a) % 3 != 0:
    print("No")
elif len(a_counter) > 3 or len(a_counter) <= 1:
    print("No")
elif len(a_counter) == 3:
    if (
        a_counter[a_counter_li[0]] == n // 3
        and a_counter[a_counter_li[1]] == n // 3
        and a_counter[a_counter_li[2]] == n // 3
    ):
        if a_counter_li[0] ^ a_counter_li[1] ^ a_counter_li[2] == 0:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    a_counter_li.sort()
    if a_counter_li[0] == 0 and a_counter[a_counter_li[0]] == n // 3:
        print("Yes")
    else:
        print("No")

from collections import Counter

n = int(eval(input()))
a = list(map(int, input().split()))
a_counter = Counter(a)
k = list(a_counter.keys())
v = list(a_counter.values())
if len(a_counter) == 3 and k[0] ^ k[1] ^ k[2] == 0 and v[0] == v[1] == v[2]:
    print("Yes")
elif len(a_counter) == 2 and 0 in k and (v[0] == v[1] * 2 or v[1] == v[0] * 2):
    print("Yes")
elif len(a_counter) == 1 and 0 in k:
    print("Yes")
else:
    print("No")

-a_counter_li = list(a_counter) -if sum(a) == 0: +k = list(a_counter.keys()) +v = list(a_counter.values()) +if len(a_counter) == 3 and k[0] ^ k[1] ^ k[2] == 0 and v[0] == v[1] == v[2]: -elif len(a) % 3 != 0: +elif len(a_counter) == 2 and 0 in k and (v[0] == v[1] * 2 or v[1] == v[0] * 2): +    print("Yes") +elif len(a_counter) == 1 and 0 in k: +    print("Yes") +else: -elif len(a_counter) > 3 or len(a_counter) <= 1: -    print("No") -elif len(a_counter) == 3: -    if ( -        a_counter[a_counter_li[0]] == n // 3 -        and a_counter[a_counter_li[1]] == n // 3 -        and a_counter[a_counter_li[2]] == n // 3 -    ): -        if a_counter_li[0] ^ a_counter_li[1] ^ a_counter_li[2] == 0: -            print("Yes") -        else: -            print("No") -    else: -        print("No") -else: -    a_counter_li.sort() -    if a_counter_li[0] == 0 and a_counter[a_counter_li[0]] == n // 3: -        print("Yes") -    else: -        print("No")