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

from collections import Counter
a_dict = Counter(a_list)

start = a_list[0]
# 数を減らさない。
# a_dict[a] -= 1

a_keys = a_dict.keys()

def check():
    for a1 in a_keys:
        print("for1",start,a1)
        a0 = start
        tmp_dict = a_dict.copy()
#         tmp_dict[a1] -= 1
        for i in range(N):
#             print(" for2",i,a0,a1)
#             print(tmp_dict)
            next_a = int(bin(a0^a1), 0)
            if not next_a in tmp_dict:
#                 print(next_a," not in dict")
                break
            if tmp_dict[next_a] <= 0:
#                 print(next_a," dict 0")
                break
            a0 = a1
            a1 = next_a
            tmp_dict[next_a] -= 1
            if i == N-1:
                return True
    return False

if check():
    print("Yes")
else:
    print("No")