N = int(input())
d = list(map(int,input().split()))
d_unique = list(set(d))

if len(d) == 1:
    if d_unique == 0:
        print('Yes')
    else:
        print('No')
else:
    if N%3 != 0 :
        print('No')
    else :
        if len(d) == 2 :
            i1 = d_unique[0]
            i2 = d_unique[1]
            len_i1 = d.count(i1)
            len_i2 = d.count(i2)
            if len_i1 ==  N/3 or len_i2 == N/3 :
                print('Yes')
            else :
                print('No')
        elif len(d) == 3 :
            i1 = d_unique[0]
            i2 = d_unique[1]
            i3 = d_unique[2]
            len_i1 = d.count(i1)
            len_i2 = d.count(i2)
            len_i3 = d.count(i3)
            if len_i1 ==  N/3 and len_i2 == N/3 :
                print('Yes')
            else :
                print('No')     