N=int(input())
A = list(map(int,input().split()))
if(A.count(0) != 0):
    if(A.count(0) == N):
        print('Yes')
    elif(N % 2 == 0):
        a = -1
        b = -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 == N and a == b):
                print('Yes')
            else:
                print('No')
        else:
            print('No')
    else:
        print('No')
else:
    if(N % 3 == 0):
        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')
    else:
        print('No')