import sys,heapq,math,resource
from collections import deque,defaultdict
printn = lambda x: sys.stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True  and False
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

def setrlim():
  sys.setrecursionlimit(250000)
  soft,hard = resource.getrlimit(RLIMIT_STACK)
  # setrlimit works on ubuntu (and atcoder), but not on WSL
  #resource.setrlimit(RLIMIT_STACK, (128*1024*1024,hard))

n = inn()
a = inl()
h = {} # defaultdict(int)
ddprint(n)
ddprint(a)
for x in a:
    h[x] = (1 if x not in h else h[x]+1)
x = a[0] if a[0]!=0 else a[1] if a[1]!=0 else a[2]
if len(h.keys()) == 3 and h[a[0]] == h[a[1]] and h[a[2]] == h[a[1]] and a[0]^a[1]==a[2]:
    print('Yes')
elif len(h.keys()) == 2 and (a[0]==0 or a[1]==0 or a[2]==0) and h[0]*2 == h[x]:
    print('Yes')
elif len(h.keys()) == 1 and a[0]==0:
    print('Yes')
else:
    print('No')
