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:
        c=[0,0,0]
        for i in range(N):
            for j in range(3):
                if b[j]==a[i]:
                    c[j]+=1
        if c[0]==c[1]==c[2] and b[0]^b[1]==b[2]:
            print("Yes")
        else:
            print("No")
    else:
        print("No")

        