N = int(input())
a = list(map(int, input().split()))
a.sort()
x = a[0]
y = a[N // 3]
z = a[- N // 3]
if x == 0 and a[-1] == 0:
	print('Yes')
else:
	if N % 3 == 0:
		if a.count(x) == N // 3 and a.count(y) == N // 3 and a.count(z) == N // 3: 
			if x ^ y == z and y ^ z == x and z ^ x == y:
				print('Yes')
			else:
				print('No')
		else:
			print('No')
	else:
		print('No')