import sys
n=int(input())
a=list(map(int,input().split()))
if(n%3!=0):
    print("No")
else:
    seta=list(set(a))
    nums=len(set(a))
    if(nums>3):
        print("No")
    elif(nums==3):
        if(seta[0] ^ seta[1] ^ seta[2] == 0):
            print("Yes")
        else:
            print("No")
    elif(nums==2):
        if(a.count(seta[0])==n//3 and (seta[0] ^ seta[1] ^ seta[1] == 0)):
            print("Yes")
        elif(a.count(seta[1])==n//3 and (seta[1] ^ seta[0] ^ seta[0] == 0)):
            print("Yes")
        else:
            print("No")
    elif(nums==1):
        if(seta[0]==0):
            print("Yes")
        else:
            print("No")
