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

b = list(set(a))
c = [0]*len(b)

for i in range(n):
    for j in range(len(b)):
        if a[i]==b[j]:
            c[j]+=1
            break

if n%3!=0:
    if len(b)==0 and b[0]==0:
        print('Yes')
        exit()
    else:
        print('No')
        exit()

if len(b)==1:
    if b[0]^b[0]==b[0]:
        print('Yes')
        exit()
elif len(b)==2:
    if c[0]==n*2//3:
        if b[0]^b[0]==b[1] and b[0]^b[1]==b[0]:
            print('Yes')
            exit()
    elif c[1]==n*2//3:
        if b[1]^b[1]==b[0] and b[0]^b[1]==b[1]:
            print('Yes')
            exit()
elif len(b)==3:
    if b[0]^b[1]==b[2] and b[1]^b[2]==b[0] and b[2]^b[0]==b[1]:
        print('Yes')
        exit()

print('No')

