n = int(input())
a = [int(i) for i in input().split()]
a.sort()
c = 0
for i in range(len(a)-1):
	if a[i] != int(bin(a[i-1]^a[i+1]),0):
		c=1
		print("No")
		break
if c==0:
	if a[-1] != int(bin(a[0]^a[-2]),0):
		print("No")
	else:
		print("Yes")