N = int(eval(input()))

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

if len(set(a)) == 1 and a[0] == 0:

    print("Yes")

    exit()

if N%3 != 0:

    print("No")

    exit()



import collections

sa = list(set(a))

sa.sort()

B = collections.Counter(a)



if len(sa) == 2 and 0 in sa:

    if B[0] == N//3 and B[sa[1]] == N*2//3:

        print("Yes")

    else: print("No")

    exit()

if len(sa) != 3:

    print("No")

    exit()



if B[sa[0]] == B[sa[1]] == B[sa[2]]:

    print(("Yes" if sa[0] ^ sa[1] == sa[2] else "No"))

else:

    print("No")
import collections

N = int(eval(input()))

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

B = collections.Counter(a)

k = list(B.keys())

v = list(B.values())



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

    print("Yes")

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

    print("Yes")

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

    print("Yes")

else: print("No")
N = int(eval(input()))
a = list(map(int, input().split()))
if len(set(a)) == 1 and a[0] == 0:
    print("Yes")
    exit()
if N % 3 != 0:
    print("No")
    exit()
import collections

sa = list(set(a))
sa.sort()
B = collections.Counter(a)
if len(sa) == 2 and 0 in sa:
    if B[0] == N // 3 and B[sa[1]] == N * 2 // 3:
        print("Yes")
    else:
        print("No")
    exit()
if len(sa) != 3:
    print("No")
    exit()
if B[sa[0]] == B[sa[1]] == B[sa[2]]:
    print(("Yes" if sa[0] ^ sa[1] == sa[2] else "No"))
else:
    print("No")

import collections

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

+import collections + -if len(set(a)) == 1 and a[0] == 0: +B = collections.Counter(a) +k = list(B.keys()) +v = list(B.values()) +if len(B) == 3 and k[0] ^ k[1] ^ k[2] == 0 and v[0] == v[1] == v[2]: -    exit() -if N % 3 != 0: -    print("No") -    exit() -import collections - -sa = list(set(a)) -sa.sort() -B = collections.Counter(a) -if len(sa) == 2 and 0 in sa: -    if B[0] == N // 3 and B[sa[1]] == N * 2 // 3: -        print("Yes") -    else: -        print("No") -    exit() -if len(sa) != 3: -    print("No") -    exit() -if B[sa[0]] == B[sa[1]] == B[sa[2]]: -    print(("Yes" if sa[0] ^ sa[1] == sa[2] else "No")) +elif len(B) == 2 and 0 in k and (v[0] == 2 * v[1] or v[1] == 2 * v[0]): +    print("Yes") +elif len(B) == 1 and 0 in k: +    print("Yes")