from collections import Counter
N=int(input())
a=list(map(int,input().split()))
tmp=Counter(a)
if len(tmp.keys())!=3 or len(a)%3!=0:
    print("No")
else:
    key=list(tmp.keys())
    ans=list(tmp.values())
    #print(key)
    #print(ans)
    if ans[0]==ans[1] and ans[0]==ans[2]:
        if key[0]^key[1]==key[2]:
            print("Yes")
            exit()
print("No")