N = int(input())
aaa = sorted([int(i) for i in input().split()])


count0 = aaa.count(0)
countleft = aaa.count(aaa[0])
countright = aaa.count(aaa[-1])
buff1 = aaa[0]
buff2 = aaa[-1]
aaa = [i for i in aaa if i!=buff1 and i!=buff2]
buff3 = aaa[0]
countmid = aaa.count(buff3)

if count0 == N:
    print("Yes")
    exit()
elif N%3==0 and count0 == N/3 and countright == N/3*2:
    print("Yes")
    exit()
elif N%3==0 and countleft == N/3 and countright == N/3 and countmid == N/3:
    print("Yes")
    exit()
print("No")

