n = input()
dic = {}
for i in map(int, raw_input().split()):
	if i in dic:
		dic[i] += 1
	else:
		dic[i] = 1
if len(dic) > 3:
	print "No"
elif len(dic) > 1:
	ans = []
	vals = []
	for i in dic:
		vals.append(i)
	j = 0
	for i in range(n):
		while 1:
			if dic[vals[j%len(vals)]]:
				ans.append(vals[j%len(vals)])
				j += 1
				break
			j += 1
	for i in range(n):
		if ans[(i-1)%n]^ans[(i+1)%n] != ans[i]:
			print "No"
			exit(0)
	print "Yes"
else:
	if 0 in dic:
		print "Yes"
	else:
		print "No"