N=int(input())
a=[int(i) for i in input().split()]
b=list(set(a))
if len(b)==1:
    if b[0]==0:
        print("Yes")
    else:
        print("No")
else:
    if N%3==0 and len(b)==3:
        D={b[0]:0,b[1]:0,b[2]:0}
        for i in range(N):
            D[a[i]]+=1
        if D[b[0]]==D[b[1]] and D[b[1]]==D[b[2]] and b[0]^b[1]==b[2]:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
