nn = map(int, raw_input().split())
nn = nn[0]
aa = map(int, raw_input().split())

def solve(n,a):
	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:
		for keys in a_dict.keys():
			if not a_dict[keys] == n // 3:
				print 'No'
				return
		
		print 'Yes'
		return


	if len(a_dict.keys()) == 2:
		if not 0 in a_dict.keys():
			print 'No'
			return
		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'
	return


solve(nn, aa)
