import copy
import bisect
'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)
#'''
N = int(input())
a = list(map(int, input().split()))

M = len(format(max(a), 'b'))
first_a = format(a[0], 'b')
full_bit = (1 << M) - 1
candidate = []

for i in range(1, N):
	if a[0] | a[i] == full_bit:
		candidate.append(a[i])

tmp1 = a[0]
flag = False

for i in range(len(candidate)):
	tmp_list = copy.copy(a)
	tmp1 = a[0]
	tmp2 = candidate[i]
		
	for j in range(N):
		index = bisect.bisect_left(tmp_list, tmp1 ^ tmp2)
		
		if tmp1 ^ tmp2 == tmp_list[index]:
			tmp_list.pop(index)
			tmp1, tmp2 = tmp2, tmp1 ^ tmp2
			if j == N - 1:
				flag = True
				
if flag:
	print('Yes')
else:
	print('No')