import copy
import numpy

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

for i in range(N-1):
    first = List[i]
    a = copy.deepcopy(List)
    
    for j in range(i+1,N-1):
        second = a[j]
        while(len(a) > 2):
            
            xor = bin(first ^ second)
            check = int(xor,2)

            if (check in a):
                a.remove(second)
                first = a[j]
                second = check

            else:
                break

            if (len(a) == 2):
                print("Yes")
                exit()

print("No")
