
n = map(int, raw_input().split())
n = n[0]
a = map(int, raw_input().split())


all_zero = True
for number in a:
	if number != 0:
		all_zero = False
		break

if all_zero:
	print 'Yes'
	return

a_dict = {}
for number in a:
	if number in a_dict.keys(): 
		a_dict[number] += 1
	else:
		a_dict[number] = 1

if len(a_dict.keys()) > 3:
	print 'No'
	return

if len(a_dict.keys()) == 3:
	result = True
	for keys in a_dict.keys():
		if not a_dict[keys] == n // 3:
			result = False
			break
	if result:
		print 'Yes'


if len(a_dict.keys()) == 2:
	if not '0' in a_dict.keys():
		print 'No'
		break
	for keys in a_dict.keys():
		if keys == 0:
			if not a_dict[keys] == n // 3:
				print 'No'
				return
		else: 
			if not a_dict[keys] == 2 * n // 3:
				print 'No'
				return
print 'Yes'

