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

if N%3 != 0:
    print("No")
    exit()
else:
    count0 = aaa.count(0)
    countleft = aaa.count(aaa[0])
    countmid = aaa.count(aaa[int((len(aaa)+1)/2)])
    countright = aaa.count(aaa[-1])
    if count0 == N:
        print("Yes")
        exit()
    elif count0 == N/3 and countright == N/3*2:
        print("Yes")
        exit()
    elif countleft == N/3 and countright == N/3 and countmid == N/3:
        print("Yes")
        exit()
print("No")
