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

tmp = 0
for i in A:
    tmp ^= i

flag = False
if N % 3 == 0:
    if tmp == 0:
        flag = True
elif N % 3 == 1:
    if tmp == A[-1]:
        flag = True
elif N % 3 == 2:
    if tmp == (A[-1] ^ A[-2]):
        flag = True

print('Yes' if flag else 'No')