There are N cats. We number them from 1 through N.

Each of the cats wears a hat. Cat i says: "there are exactly a_i different colors among the N - 1 hats worn by the cats except me."

Determine whether there exists a sequence of colors of the hats that is consistent with the remarks of the cats.

Constraints

* 2 ≤ N ≤ 10^5
* 1 ≤ a_i ≤ N-1

Input

Input is given from Standard Input in the following format:


N
a_1 a_2 ... a_N


Output

Print `Yes` if there exists a sequence of colors of the hats that is consistent with the remarks of the cats; print `No` otherwise.

Examples

Input

3
1 2 2


Output

Yes


Input

3
1 1 2


Output

No


Input

5
4 3 4 3 4


Output

No


Input

3
2 2 2


Output

Yes


Input

4
2 2 2 2


Output

Yes


Input

5
3 3 3 3 3


Output

No
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda:sys.stdin.readline().rstrip()
def resolve():
    n=int(input())
    A=list(map(int,input().split()))
    m=min(A); M=max(A)

    # 種類数が x だとして
    # 自分の色が他にいない -> x-1
    # 自分の色が他にいる -> x
    # よって M-m は1以下
    if(M-m>1):
        print("No")
        return

    # もし全員が同じ数字を言っている場合
    if(m==M):
        if(m==n-1): # 全てが1色ずつならOK
            print("Yes")
            return
        elif(m<=n//2): # 全てが2色以上ずつ用意できるならOK
            print("Yes")
            return
        else:
            print("No")
            return

    # もしズレがある場合
    s=A.count(m) # 自分だけの色を持つ数
    t=A.count(M) # 複数で色を共有する数
    # 色の種類は最小でs+1、最大でs+t//2
    if(s+1<=M<=s+t//2):
        print("Yes")
    else:
        print("No")

resolve()