N = int(input())
a = list(map(int,input().split()))
count = 0
for i in range(N-1):
    b = a[i-1] ^ a[i+1]
    if a[i] == b:
        count += 1
if count == (N-1):
    print('Yes')
else:
    print('No')