n=int(input())
a=list(map(int,input().split()))
a.sort()
b=int(n/3)
if(a[0]==a[n-1] and a[0]==0):
    print('Yes')
elif(n%3!=0):
    print('No')
elif(a[0]==a[b-1] and a[b-1]!=a[b] and a[b]==a[n-1]):
    if(a[0]^a[n-1]^a[n-1]==0):
        print('Yes')
    else:
        print('No')
elif(a[0]==a[2*b-1] and a[2*b-1]!=a[2*b] and a[2*b]==a[n-1]):
    if(a[0]^a[0]^a[n-1]==0):
        print('Yes'):
    else:
        print('No')
else:
    if(a[0] == a[b-1] and a[b-1] != a[b]):
        if(a[b]==a[2*b-1] and a[2*b-1]!=a[2*b]):
            if(a[2*b]==a[n-1]):
                if(a[0]^a[b]^a[n-1]==0):
                    print('Yes')
                else:
                    print('No')
            else:
                print('No')
        else:
            print('No')
    else:
        print('No')
    