N = int(input())
a = list(map(int,input().split()))
a.sort()
if N%3==0:
	k = N//3
	flg = 0
	x1, x2, x3 = -1, -1, -1
	if a[0]==a[k-1]:
		x1 = a[0]
		flg +=1
	if a[k]==a[2*k-1]:
		x2 = a[k]
		flg +=1
	if a[2*k]==a[3*k-1]:
		x3 = a[2*k]
		flg +=1
	if flg == 3:
		if (x1^x2)==x3 and (x2^x3)==x1 and (x3^x1)==x2:
			print("Yes")
		else:
			print("No")
	else:
		print("No")
else:
	print("No")