N=int(input())
A=list(map(int,input().split()))
if all(map(lambda x:x==0,A)) or (sum(map(lambda x:x==0,A))==(N/3) and (len(set(A))==2) or (A[0]^A[1]^A[2]==0 and len(set(A))==3)):
    print("Yes")
else:
    print("No")