import collections
N = int(input())
a = list(int(i) for i in input().split())
chk = sum(a)
if N == 3:
	if ((chk+2)&(chk+1)) == 0:
		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")
