N=int(input())
A = list(map(int,input().split()))
if(N % 3 != 0):
    print('No')
else:
    a = -1
    b = -1
    c = -1
    aa = A[0]
    a = A.count(aa)

    bb = -1

    for i in A:
        if(aa != i):
            bb = i
            break
    if(bb != -1):
        b = A.count(bb)
        if(a == b):
            cc = -1

            for i in A:
                if(aa != i and bb != i):
                    cc = i
                    break
            if(cc != -1):
                c = A.count(cc)
                if(b == c and a + b + c == N):
                    print('Yes')
                else:
                    print('No')
            else:
                print('No')
        else:
            print('No')
    else:
        print('No')