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] != 0 and a[1] != 0 and a[2] != 0 :
			if ((chk+2)&(chk+1)) == 0:
				print("Yes")
			else:
				print("No")
		else:
			if a[0] == 0:
				if a[1] == a[2]:
					print("Yes")
				else:
					print("No")
			if a[1] == 0:
				if a[2] == a[0]:
					print("Yes")
				else:
					print("No")
			if a[2] == 0:
				if a[0] == a[1]:
					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()):
				chk=chk//list(l.values())[0]
				if ((chk+2)&(chk+1)) == 0:
					print("Yes")
				else:
					print("No")
			else:
				print("No")
		else:
			if len(l.values()) == 2 and a.count(0) == N//3:
				print("Yes")
			else:
				print("No")
