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

from collections import Counter

count = Counter((a))

len_count = len(count)

if len_count >= 4:
    print("No")
elif len_count == 1:
    if a[0] == 0:
        print("Yes")
    else:
        print("No")
elif len_count == 3:
    if len(Counter(count.values())) == 1:
        print("Yes")
    else:
        print("No")
else:
    if count[0] * 3 == len(a):
        print("Yes")
    else:
        print("No")

