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