from collections import Counter

N = int(input())
A = list(map(int, input().split()))

c = Counter(A)
K = c.keys()

ans = "No"
if len(K)==3:
    B = []
    for k in K:
        B.append(k)
    if c[B[0]]==c[B[1]] and c[B[1]]==c[B[2]] and B[0]^B[1]==B[2]:
        ans = "Yes"
elif len(K)==2:
    B = []
    for k in K:
        B.append(k)
    if c[B[0]]==c[B[1]] and (B[0]==0 or B[1]==0):
        ans = "Yes"
elif len(K)==1:
    for k in K:
        if k==0:
            ans = "Yes"

print(ans)
