import sys
n = int(input())
a = list(map(int, input().split( )))

#3つ置きに一致する
S = {}
for ai in a:
    if ai in S:
        S[ai]+=1
    else:
        S[ai] = 1

if len(S)>3:
    print("No")
    sys.exit()
    
if len(S) ==3:
    A = list(S.keys())
    if A[0]==A[1]^A[2] and S[A[0]]==S[A[1]] and S[A[1]] == S[A[2]]:
        print("Yes")

elif len(S) == 2:
    A = list(S.keys())
    if A[0]== 0 or  A[1]==0 and S[A[0]] == S[A[1]]:
        print("Yes")
elif len(S)==1:
    if S.values()==[0]:
        print("Yes")
else:
    print("No")

