n=int(input())
a=list(map(int,input().split()))
s=0
a.sort()
if a[0]==0:
    if a.count(a[0])==n:
        s=1
    if n%3==0:
        if (a.count(a[0])==n//3 and a.count(a[n//3])==n//3*2):
            s=1
else:
    if n%3==0:
        if a.count(a[0])==n//3 and a.count(a[n//3])==n//3 and a.count(a[n//3*2])==n//3:
            s=1
if s==1:
    print("Yes")
else:
    print("No")