N = int(eval(input()))

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



minColor = min(A)

maxColor = max(A)



if minColor == maxColor:

    if minColor == N - 1:  # 各色の猫が1匹ずつ

        print('Yes')

    elif minColor * 2 <= N:  # 各色の猫が2匹以上

        print('Yes')

    else:

        print('No')

    exit()



if minColor + 1 != maxColor:

    print('No')

    exit()



minCnt = 0

maxCnt = 0



for a in A:

    if a == minColor:

        minCnt += 1

    elif a == maxColor:

        maxCnt += 1

    else:

        print('No')

        exit()



# minCnt : 1匹だけの色

# maxCnt : 2匹以上の色

# 全体でmaxColor個の色



if (maxColor - minCnt) * 2 <= maxCnt and maxColor >= minCnt + 1:

    print('Yes')

else:

    print('No')

from collections import Counter



N = int(eval(input()))

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



if len(list(A.keys())) >= 3:

    print('No')

    exit()



if len(list(A.keys())) == 1:

    p = list(A.keys())[0]

    print(('Yes' if 2 * p <= N or p == N - 1 else 'No'))

    exit()



p1, p2 = sorted(A.keys())

print(('Yes' if p2 - p1 == 1 and (A[p1] + 1) <= p2 <= (A[p1] + A[p2] // 2) else 'No'))

N = int(eval(input()))
A = list(map(int, input().split()))
minColor = min(A)
maxColor = max(A)
if minColor == maxColor:
    if minColor == N - 1:  # 各色の猫が1匹ずつ
        print("Yes")
    elif minColor * 2 <= N:  # 各色の猫が2匹以上
        print("Yes")
    else:
        print("No")
    exit()
if minColor + 1 != maxColor:
    print("No")
    exit()
minCnt = 0
maxCnt = 0
for a in A:
    if a == minColor:
        minCnt += 1
    elif a == maxColor:
        maxCnt += 1
    else:
        print("No")
        exit()
# minCnt : 1匹だけの色
# maxCnt : 2匹以上の色
# 全体でmaxColor個の色
if (maxColor - minCnt) * 2 <= maxCnt and maxColor >= minCnt + 1:
    print("Yes")
else:
    print("No")

from collections import Counter

N = int(eval(input()))
A = Counter(list(map(int, input().split())))
if len(list(A.keys())) >= 3:
    print("No")
    exit()
if len(list(A.keys())) == 1:
    p = list(A.keys())[0]
    print(("Yes" if 2 * p <= N or p == N - 1 else "No"))
    exit()
p1, p2 = sorted(A.keys())
print(("Yes" if p2 - p1 == 1 and (A[p1] + 1) <= p2 <= (A[p1] + A[p2] // 2) else "No"))

+from collections import Counter + -A = list(map(int, input().split())) -minColor = min(A) -maxColor = max(A) -if minColor == maxColor: -    if minColor == N - 1:  # 各色の猫が1匹ずつ -        print("Yes") -    elif minColor * 2 <= N:  # 各色の猫が2匹以上 -        print("Yes") -    else: -        print("No") -    exit() -if minColor + 1 != maxColor: +A = Counter(list(map(int, input().split()))) +if len(list(A.keys())) >= 3: -minCnt = 0 -maxCnt = 0 -for a in A: -    if a == minColor: -        minCnt += 1 -    elif a == maxColor: -        maxCnt += 1 -    else: -        print("No") -        exit() -# minCnt : 1匹だけの色 -# maxCnt : 2匹以上の色 -# 全体でmaxColor個の色 -if (maxColor - minCnt) * 2 <= maxCnt and maxColor >= minCnt + 1: -    print("Yes") -else: -    print("No") +if len(list(A.keys())) == 1: +    p = list(A.keys())[0] +    print(("Yes" if 2 * p <= N or p == N - 1 else "No")) +    exit() +p1, p2 = sorted(A.keys()) +print(("Yes" if p2 - p1 == 1 and (A[p1] + 1) <= p2 <= (A[p1] + A[p2] // 2) else "No"))