n=int(input())
a=list(map(int, input().split())) 
count=0
a.sort()

if a.count(0)==n:
    print('Yes')
elif n%3==0:
    if a.count(0)==n/3 and a.count(a[n//3])==n/3*2:
        print('Yes')
    elif a.count(0)==n/3 and a.count(a[n//3])==n/3 and a.count(a[n//3*2])==n/3:
        print('Yes')
    else:
        print('No')
else:
    print('No')