import sys
import bisect
input = sys.stdin.readline

#+++++

def search(l,v, p):
	left=bisect.bisect_left(l, v)
	if left >= len(l):
		return -1
		
	if l[left] != v:
		return -1
	
	while True:	
		if p[left] == -1:
			return left
		else:
			left+=1
		if left >= len(l) or l[left] != v:
			return -1
		
		
def main():
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	
	init=l[0]

	for i, vi in enumerate(l[1:],1):
		ll=[-1 for _ in l]
		
		ll[0]==1
		ll[i]==1
		
		pre_v = l[i]
		pre_i = i
		next_v = init ^ vi
		next_i = search(l, next_v, ll)
		ff=0
		for k in range(n-2):
			if next_i < 0:
				ff=1
				break
				
			ll[next_i]=1
			#print(next_v,pre_v)
			t=next_v^pre_v
			pre_v = next_v
			pre_i = next_i
			next_v=t
			next_i = search(l, next_v, ll)
		
		if ff ==0:
			if next_v == l[0]:
				return 'Yes'
			
	return 'No'
	
#+++++

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		
	ret = main()
	if ret is not None:
		print(ret)