n = int(input())
a = list( map(int, input().split()))

total = 0
b = [0]*(n+1)
for i in range(n):
    total = int(bin(total ^ a[i]),2) 

b[0] = a[0]
for i in range(0,n-3):
    b[i+3] = int(bin(total ^b[i]),2)

b[2] = int(bin(total ^b[-1]),2)
b[1] = int(bin(total ^b[-2]),2)
b[0] = int(bin(total ^b[-3]),2)

if n == 3:
    b[0] = int(bin(total ^a[0]),2)
    b[1] = int(bin(total ^a[1]),2)
    b[2] = int(bin(total ^a[2]),2)

b[n] = int(bin(total ^b[n-3]),2)
if b[0] == b[n]:
    print('Yes')
else:
    print('No')
