# A - XOR Circle
import itertools
import sys

N = int(input())
seq = list(map(int, input().split()))

# pattern = list(itertools.permutations(seq))
# for i in range(0, N):
#     for j in range(0, len(pattern[i])):
#         if (pattern[i][j-2] ^ pattern[i][j]) != pattern[i][j-1]:
#             print('No')
#             sys.exit(0)

for j in range(N):
    if (seq[j-2] ^ seq[j]) != seq[j-1]:
        print('No')
        sys.exit(0)

print('Yes')