import collections
N = int(input())
a = list(map(int,input().split()))

a = collections.Counter(a)
a_list = list(a.items())
a_list = sorted(a_list,key = lambda a_list:a_list[0])
print(a_list)

if len(a_list) == 1:
	if a_list[0][0] == 0:
		print("Yes")
	else:
		print("No")
elif len(a_list) == 2:
	if ((a_list[0][0] == 0) and (a_list[0][1] == int(N/3)) and \
		(a_list[1][1] == int(2*N/3))):
		print("Yes")
	else:
		print("No")
elif len(a_list) == 3:
	if (a_list[0][1] == int(N/3)) and \
		(a_list[1][1] == int(N/3) and \
			a_list[2][1] == int(N/3)):
		print("Yes")
	else:
		print("No")
else:
	print("No")