import itertools
import copy

n = input("")
n = int(n)
num = input("").split(" ")
for i in range(len(num)):
    num[i] = int(num[i])

ans = "No"
all = 0
stop = 0
for i in range(n):
    num2 = copy.copy(num)
    num2.remove(num2[i])
    com_list = list(itertools.combinations(num2, 2))
    for j in range(len(com_list)):
        list(com_list[j])
        a = com_list[j][0]
        b = com_list[j][1]
        if int(bin(a^b), 2) == num[i]:
            all += 1
            break
        else:
            stop += 1
    if stop == len(com_list):
        break
if all == n:
    ans = "Yes"

print(ans)