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

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