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

if N%3 != 0:
    print("No")
    exit()
else:
    count0 = aaa.count(0)
    if count0 == N:
        print("Yes")
        exit()
    bbb = [i for i in aaa if i != 0]
    if bbb.count(bbb[0])==N/3*2:
        print("Yes")
        exit()
    ccc = [i for i in aaa if i!=aaa[0]]
    ddd = [i for i in ccc if i!=ccc[0]]
    eee = [i for i in ddd if i!=ddd[0]]
    if eee==[] and len(aaa)-len(ccc)==len(ccc)-len(ddd) and len(ccc)-len(ddd)==len(ddd):
        print("Yes")
        exit()
    print("No")
    exit()