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

k = 0
for i in range(-2, N-2):
    if not A[i+1] == (A[i] ^ A[i+2]):
        k = 0
        print('No')
        break
    k = 1

if k == 1:
    print('Yes')
