N = int(input())
a = list(map(int, input().split()))
a.sort()
x = a[0]
y = a[N // 3]
z = a[- N // 3]
if N % 3 != 0:
	print('No')
else:
	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')