N = int(input())
A = list(map(int,input().split()))
B = [A[0],A[1],A[0]^A[1]]
flag = 0
for i in range(2,N):
    if A[i] not in C:
        flag = 1
        break
if flag==1:
    print("No")
else:
    if N%3==0:
        if A[0]==A[1]==0:
            print("Yes")
        elif A[0]==0 or A[1]==0:
            cnt = 0
            for i in range(N):
                if A[i]==0:
                    cnt += 1
            if cnt==N//3:
                print("Yes")
            else:
                print("No")
        else:
            C = {A[0]:0,A[1]:0,A[0]^A[1]:0}
            for i in range(N):
                C[A[i]] += 1
            if C[A[0]]==C[A[1]]==C[A[0]^A[1]]:
                print("Yes")
            else:
                print("No")
    else:
        if A[0]==A[1]==0:
            print("Yes")
        else:
            print("No")
    