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

P=[a[0],a[1],a[2]]
P=sorted(P)[::-1]
x,y,z=P[0],P[1],P[2]

flag=False
if x^y^z==0:
    if x==y and y==z and x==0:
        if a.count(0)==N:
            flag=True
    elif x!=0 and y==z and y==0:
        if a.count(x)==2*N/3 and a.count(0)==N/3:
            flag=True
    elif a.count(x)==a.count(y) and a.count(y)==a.count(z):
        flag=True

print('Yes' if flag else 'No')