from collections import Counter
N = int(input())
a = list(map(int, input().split()))
C = Counter(a)
if len(C) == 3:
    x = C[a[0]]
    for k in C:
        if C[k] != x:
            print('No')
            quit()
    print('Yes')
else:
    if 0 not in C:
        print('No')
        quit()
    for k in C:
        if k != 0:
            if C[k] == 2 * C[0]:
                print('Yes')
            else:
                print('No')
            break
