N, *A = map(int, open(0).read().split())

ans = []
for i in range(N):
    p = i-1
    n = i+1
    if i == 0:
        p = -1
    if i == N-1:
        n = 0
    ans.append(A[p] ^ A[n])

A.sort()
ans.sort()

print('Yes' if A == ans else 'No')