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()
	na,nb,nc=C.values()
	if a^b==c and na==nb==nc:
		print "Yes"
		quit()
elif len(C)==2:
	L=C.items()
	L.sort()
	a,b=L[0][0],L[1][0]
	na,nb=L[0][1],L[1][1]
	if a==0 and na==N/3:
		print"Yes"
		quit()

else:
	print "No"


print "No"