N = int(input())
a = list(map(int, input().split()))
res = 0
for i in range(N):
    res ^= a[i]

if N == 3:
    print('Yes') if res==0 else print('No')
else:
    for i in range(N):
        if a[i]^a[(i+3)%N] != 0:
            print('No')
            exit()
    print('Yes')