from collections import*
n=int(input())
a=dict(Counter(list(map(int,input().split()))))
flag=1
ak=list(a.keys())
if n%3:flag=0
elif len(a)==1 and ak[0]!=0:flag=0
elif len(a)==2 and a.get(0)!=n//3:flag=0
elif len(a)==3 and not(ak[0]==ak[1]==ak[2]==n//3):flag==0
print(['No','Yes'][flag])