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] = int(bin(total ^a[0]),2)
b[1] = int(bin(total ^a[1]),2)
b[2] = int(bin(total ^a[2]),2)

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

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

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

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