N = int(input())
A = list(map(int,input().split()))
setA = list(set(A))
if len(setA) == 0 and setA[0] == 0:
	print("Yes")
	exit()
if N % 3 != 0:
	print("No")
	exit()
if len(setA) == 1 or len(setA) > 3:
	print("No")
	exit()
if len(setA) == 2:
	if 0 in setA:
		setA.sort()
		if A.count(0) == N // 3 and A.count(setA[1]) == (N // 3) * 2:
			print("Yes")
			exit()
	print("No")
	exit()

if setA[0] ^ setA[1] != setA[2]:
	print("No")
	exit()
for a in setA:
	if A.count(a) != N // 3:
		print("No")
		exit()
print("Yes")
exit()