import collections
N = int(input())
a = list(int(i) for i in input().split())
chk = sum(a)
if a == [0] *N:
	print("Yes")
else:
	if N == 3:
			if (a[0]^a[1]) == a[2]:
				print("Yes")
			else:
				print("No")
	else:
		l = collections.Counter(a)
		if a.count(0) == 0:
			if list(l.values()) ==  [list(l.values())[0]] * len(l.values()) and len(l.keys()) == 3:
				if ((list(l.keys())[0])^(list(l.keys())[1])) == list(l.keys())[2]:
					print("Yes")
				else:
					print(list(l.keys())[0])
					print("No")
			else:
				print("No")
		else:
			if len(l.values()) == 2 and a.count(0) == N//3:
				print("Yes")
			else:
				print("No")