import collections



N = int(eval(input()))

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

a.sort()



C = collections.Counter(a)

L = len(C)

e = list(C.keys())

if (L == 1) and (C[0] > 0):

    print("Yes")

elif (L == 2) and (C[e[0]] * 2 == C[e[1]]):

    print((((e[0] ^ e[0] == e[1]) or (e[1] ^ e[1] == e[0])) and "Yes" or "No"))

elif (L == 3) and (C[e[0]] == C[e[1]]) and (C[e[1]] == C[e[2]]):

    print((((e[0] ^ e[1]) == e[2]) and "Yes" or "No"))

else:

    print("No")

import collections



N = int(eval(input()))

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

C = collections.Counter(a)

L = len(C)

e = list(C.keys())

if (L == 1) and (C[0] > 0):

    print("Yes")

elif (L == 2) and (C[e[0]] * 2 == C[e[1]]):

    print((((e[0] ^ e[0] == e[1]) or (e[1] ^ e[1] == e[0])) and "Yes" or "No"))

elif (L == 3) and (C[e[0]] == C[e[1]]) and (C[e[1]] == C[e[2]]):

    print((((e[0] ^ e[1]) == e[2]) and "Yes" or "No"))

else:

    print("No")

import collections

N = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
C = collections.Counter(a)
L = len(C)
e = list(C.keys())
if (L == 1) and (C[0] > 0):
    print("Yes")
elif (L == 2) and (C[e[0]] * 2 == C[e[1]]):
    print((((e[0] ^ e[0] == e[1]) or (e[1] ^ e[1] == e[0])) and "Yes" or "No"))
elif (L == 3) and (C[e[0]] == C[e[1]]) and (C[e[1]] == C[e[2]]):
    print((((e[0] ^ e[1]) == e[2]) and "Yes" or "No"))
else:
    print("No")

import collections

N = int(eval(input()))
a = list(map(int, input().split()))
C = collections.Counter(a)
L = len(C)
e = list(C.keys())
if (L == 1) and (C[0] > 0):
    print("Yes")
elif (L == 2) and (C[e[0]] * 2 == C[e[1]]):
    print((((e[0] ^ e[0] == e[1]) or (e[1] ^ e[1] == e[0])) and "Yes" or "No"))
elif (L == 3) and (C[e[0]] == C[e[1]]) and (C[e[1]] == C[e[2]]):
    print((((e[0] ^ e[1]) == e[2]) and "Yes" or "No"))
else:
    print("No")

-a.sort()