from collections import Counter

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

flag="No"

count_by_kw = Counter()
for i in range(n):
    count_by_kw[a[i]]+=1

print(count_by_kw)

if count_by_kw.get(0) == n:
    flag="Yes"

if count_by_kw.get(0) == n/3 and len(count_by_kw.keys())==2:
    flag="Yes"
    
if len(count_by_kw.values()) == 3:
    if count_by_kw.get(0) == count_by_kw.get(1) and count_by_kw.get(0) == count_by_kw.get(2):
        flag="Yes"
    
print(flag)



