n = int(input())
a = list(map(int, input().split()))
a.sort()
start = a[-1]
a.pop(-1)
xor_list = []
ele = []
frag = 0
for i in range(1, n-1):
    for j in range(i):
        xor_list.append(a[i]^a[j])
        ele.append([i, j])
        
fst_pair = []
for i in range(len(xor_list)):
    if start == xor_list[i]:
        fst_pair.append(ele[i])
        
if ele:
    for i in range(len(ele)):
        e_start = a[ele[i][0]]
        s_start = a[ele[i][1]]
        visited = [False for j in range(len(a))]
        visited[ele[i][0]] = True
        visited[ele[i][1]] = True
        while True:
            if all(visited):
                if start ^ e_start == s_start:
                    frag = 1
                break
            want = s_start ^ start
            if want in a:
                want_index = a.index(want)
                if visited[want_index]:
                    if break_frag == True:
                        break
                    while True:
                        break_frag = False
                        if a[want_index+1] == a[want_index] and visited[want_index+1] == False:
                            visited[want_index+1] = True
                            start = s_start
                            s_start = a[want_index]
                            break
                        elif a[want_index+1] != a[want_index]:
                            break_frag = True
                            break

                else:
                    visited[want_index] = True
                    start = s_start
                    s_start = a[want_index]    
            else:
                break
    if frag:
        print("Yes")
    else:
        print("No")
            
else:
    print("No")