import sys

if sys.platform=='ios':
	sys.stdin=open('input_file.txt')
	
N=int(input())
A=list(map(int,input().split()))

ans="No"

if N%3!=0:
	if sum(A)==0:
		ans="Yes"
else:
	if A.count(0)==N//3:
		x=0
		for i in range(3):
			if A[i]!=0:
				x=A[i]
				break
		if A.count(x)==2*N//3:
			ans="Yes"
	else:
		x,y,z=A[0],A[1],A[2]
		if A.count(x)==A.count(y) and 		A.count(y)==A.count(z):
			ans="Yes"

print(ans)