N=int(input())
A=list(map(int,input().split()))
SA=set(A)
if len(SA)==1 and A[0]==0:
    print('Yes')
elif N%3==0:
    if len(SA)==3:
        x=[0,0,0]
        y=[0,0,0]
        for i,a in enumerate(SA):
            x[i]=A.count(a)
            y[i]=a
        if x[0]==x[1] and x[1]==x[2]:
            if y[0]^y[1]==y[2] and y[1]^y[2]==y[0] and y[2]^y[0]==y[1]:
                print('Yes')
            else:
                print('No')
        else:
            print('No')
    elif len(SA)==2:
        x=[0,0]
        y=[0,0]
        for i,a in enumerate(SA):
            x[i]=A.count(a)
            y[i]=a
        if x[0]*2==x[1]:
            if y[1]==0:
                print('Yes')
            else:
                print('No')
        elif x[1]*2==x[0]:
            if y[0]==0:
                print('Yes')
            else:
                print('No')
        else:
            print('No')
else:
    print('No')