N=int(input())
A=list(map(int,input().split()))
sA=set(A)
flg=0
if len(sA)==1 and all([x==0 for x in A]):
    flg=1
elif len(sA)==2 and N%3==0:
    a,b=[A.count(x) for x in sA]
    if min(a,b)==N//3 and max(a,b)==N//3*2:
        flg=1
elif len(sA)==3 and N%3==0:
    if all([A.count(x)==N//3 for x in sA]):
        flg=1
print("Yes" if flg==1 else "No")
