N=parse(Int,readline())
M=Dict{Int,Int}()
for a=map(x->parse(Int,x),split(readline()))
	M[a]=get(M,a,0)+1
end
if N%3!=0
	println(get(M,0,0)==N?"Yes":"No")
else
	M=div(N,3)
	cum=0
	flag=true
	for (k,v)=M
		if v%M!=0
			flag=false
		else
			while v>=M
				v-=M
				cum$=k
			end
		end
	end
	if cum!=0
		flag=false
	end
	println(flag?"Yes":"No")
end
