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) == 3:
	vals = []
	for i in dic:
		vals.append(i)
	if vals[0]^vals[2] != vals[1] or vals[1]^vals[0] != vals[2] or vals[0] != vals[1]^vals[2]:
		print "No"
	elif max(dic.values()) - min(dic.values()) > 1:
		print "No"
	else:
		print "Yes"
elif len(dic) == 2:
	vals = []
	for i in dic:
		vals.append(i)
	if max(dic.values())/2 - min(dic.values()) > 1 or 0 not in vals:
		print "No"
	else:
		print "Yes"
else:
	if 0 in dic:
		print "Yes"
	else:
		print "No"