import collections
N = int(input())
A = [int(i) for i in input().split()]
A.sort()
maxele = len(bin(max(A)))-2
# print(maxele,bin(max(A)))

firstnum = A[0]
lastnum  = A[1]
pattern = True
if N%3!=0: pattern = False
Nloop=int(N/3)
c = collections.Counter(A)
Acm = c.most_common()
if len(Acm)>3: pattern = False
elif len(Acm)==3:
    eles = []
    counts = []
    for i in range(len(Acm)):
        eles.append(Acm[i][0])
        counts.append(Acm[i][1])
    if eles[0] ^ eles[1] == eles[2] and counts[0]==counts[1] and counts[0]==counts[2]:
        pattern = True
elif len(Acm)==2:
    if Acm[0][0]==0 or Acm[1][0]==0:
        pattern = True


if pattern == False:
    print("No")
else:
    print("Yes")