from collections import deque

N = int(input())
A = deque(map(int, input().split()))
first = A.popleft()


def round(a):
        B = set(A)
        eval = 0
        pre = first
        post = a
        B.discard(a)
        while len(B) != 0:
                c = pre ^ post
                if c in B:
                        B.discard(c)
                        pre = post
                        post = c
                else:
                        return 0
                        eval = 1
                        break
        
        if post ^ first == a:
                return 1
        elif eval == 0:
                return 0

ands = 0
for i in range(0, N - 1):
        ans = round(A[i])
        if ans == 1:
                print('Yes')
                break
                

if ans == 0:
        print('No')


