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