n = int(input())
A = list(map(int, input().split()))
#A.append(A[0])
B = []
for i in range(n):
    if i!=n-1:
        #print(A[i-1],A[i+1])
        B.append(A[i-1]^A[i+1])
    else:
        #print(A[i-1],A[0])
        B.append(A[i-1]^A[0])
#print(B)
B.sort()
A.sort()
for i in range(n):
    if A[i] != B[i]:
        print('No')
        exit()
print('Yes')