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 a.count(0)==N:
    flag=True
elif N%3==0:
    if a.count(x)==(2*N)//3 and a.count(0)==N//3:
        flag=True
    elif x^y^z==0 and a.count(x)==a.count(y) and a.count(y)==a.count(z):
        flag=True

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