from collections import Counter

N=input()
A=map(int, raw_input().split())

C=Counter(A)

if len(C)==1:
	if C.keys()==[0]:
		print "Yes"
		quit()
elif len(C)==3:
	a,b,c=C.keys()
	if N%3==0:
		if a^b==c:
			print "Yes"
			quit()
elif len(C)==2:
	if N%3==0:
		L=C.items()
		L.sort()
		print L
		if L[0][0]==0 and L[0][1]==N/3:
			print "Yes"
			quit()
else:
	print "No"


print "No"