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

table = {}
for i in range(len(A)):
    a = A[i]
    B = A.copy()
    B.pop(i)
    for j in range(len(B)):
        for k in range(1, len(B)):
            if A[i] == B[j]^B[k]:
                if A[i] not in table.keys():
                    table[a] = set()
                b1 = min([B[j], B[k]])
                b2 = max([B[j], B[k]])
                table[a].add( (b1, b2) )

def locate(i, a, current, rest):
    global N, table
    if a not in table.keys():
        return False
    else:
        #print("###############")
        #print("i={}".format(i))
        #print(current)
        #print("###############\n")
        L = (i - 1 + N) % N
        R = (i + 1 + N) % N
        if i==N-2 and current[L] != -1 and current[R] != -1:
            if a == current[L]^current[R]:
                return True
            else:
                return False
        else:
            current_ = current.copy()
            current_[i] = a
            for j in range(len(rest)):
                rest_ = rest.copy()
                next_a = rest_.pop(j)
                need_search = False
                for t1,t2 in table[a]:
                    if i < N-2:
                        if t1 == next_a:
                            if t2 in rest_:
                                need_search = True
                                break
                        if t2 == next_a:
                            if t1 in rest_:
                                need_search = True
                                break
                    else:
                        if t1 == next_a or t2 == next_a:
                            need_search = True
                            break
                if need_search:
                    if locate(i+1, next_a, current_, rest_) == True:
                        return True


for i in range(len(A)):
    current = [-1] * N
    rest = A.copy()
    a = rest.pop(i)

    if a in table:
        for t1, t2 in table[a]:
            if t1 in rest and t2 in rest:
                rest_ = rest.copy()
                rest_.pop(rest_.index(t1))
                rest_.pop(rest_.index(t2))
                if N==3:
                    if a == t1^t2:
                        print("Yes")
                        exit()
                elif N>3:
                    b = rest_.pop()
                    current_1 = current.copy()
                    current_1[0]   = a
                    current_1[1]   = t1
                    current_1[N-1] = t2
                    ret = locate(3, b, current_1, rest_)
                    if ret == True:
                        print("Yes")
                        exit()

                    current_2 = current.copy()
                    current_2[0]   = a
                    current_2[1]   = t2
                    current_2[N-1] = t1
                    ret = locate(3, b, current_2, rest_)
                    if ret == True:
                        print("Yes")
                        exit()

                
print("No")