from collections import Counter

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

cnt = Counter(A)

if len(cnt) == 1:
    if list(cnt.keys())[0] == 0:
        print('Yes')
    else:
        print('No')
elif len(cnt) == 2:
    t = list(cnt.keys())
    t.sort()
    if t[0] == 0:
        if cnt[0] == n/3:
            print('Yes')
        else:
            print('No')
elif len(cnt) == 3:
    for p in cnt.keys():
        if cnt[p] != n/3:
            print('No')
            break
    else:
        print('Yes')
else:
    print('No')
            