from itertools import groupby

N=int(input())
A=list(map(int,input().split()))
A.sort()
if N%3!=0:
    print('No')
else:
    X=groupby(A)
    data=[]
    for key,group in X:
        g=len(list(group))
        data.append([key,g])
    if len(data)!=3:
        print('No')
    else:
        if data[0][1]!=N//3 or data[1][1]!=N//3 or data[2][1]!=N//3:
            print('No')
        else:
            print('Yes')
