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

B = []
for i in range(N):
    if i == 0:
        B.append(A[-1] ^ A[i+1])
    elif i == N-1:
        B.append(A[i-1] ^ A[0])
    else:
        B.append(A[i-1] ^ A[i+1])

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