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

import collections
c = collections.Counter(a)


flag = False
if len(c.keys()) == 3:
    v = []
    for k in c.keys():
        v.append(c[k])

    v.sort()

    if n % 3 == 0:
        if v == [n // 3, n // 3, n // 3]:
            flag = True
    elif n % 3 == 1:
        if v == [n // 3, n // 3, n // 3 + 1]:
            flag = True
    elif n % 3 == 2:
        if v == [n // 3, n // 3 + 1, n // 3 + 1]:
            flag = True

if flag:
    print('Yes')
else:
    print('No')
