from collections import defaultdict
def main():
	N = int(input())
	A = list(map(int, input().split()))

	if all(map(lambda a: a==0, A)):
		print("Yes")
		return

	ans_dict = defaultdict(int)
	for a in A:
		ans_dict[a] += 1
	if len(ans_dict) == 3:
		xor = 0
		num = [0, 0, 0]
		i = 0
		for k in ans_dict:
			num[i] = ans_dict[k]
			xor ^= k
			i += 1
		if num[0] == num[1] and num[1] == num[2] and xor == 0:
			print("Yes")
			return
	if len(ans_dict) == 2 and 0 in ans_dict:
		num = [ans_dict[0], 0]
		for k in ans_dict:
			if k == 0:
				continue
			num[1] = ans_dict[k]
		if num[1]*2 == num[0]:
			print("Yes")
			return
	print("No")


if __name__ == '__main__':
	main()