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 java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.StringTokenizer;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

public class Main {
    public static void main(final String[] args) {
        final FastScanner scanner = new FastScanner(System.in);
        final int n = scanner.nextInt();
        final Map<Integer, Integer> map = new HashMap<>();
        IntStream.range(0, n)
                .mapToObj(i -> scanner.nextInt())
                .forEach(value -> map.compute(value, (k, v) -> v == null ? 1 : v + 1));

        final List<Integer> keys = map.keySet().stream().sorted().collect(Collectors.toList());
        if (keys.size() == 1) {
            System.out.println(keys.get(0) == n - 1 || keys.get(0) <= n / 2 ? "Yes" : "No");
            return;
        }

        final int smaller = keys.get(0);
        final int bigger = keys.get(1);
        if (keys.size() >= 3 || bigger - smaller != 1) {
            System.out.println("No");
            return;
        }

        final int min = map.get(keys.get(0));
        final int max = map.get(keys.get(1));
        if (min >= bigger) {
            System.out.println("No");
            return;
        }
        final int rest = n - min;
        final int numOfBiggerGroups = bigger - min;
        System.out.println(rest / numOfBiggerGroups >= 2 || rest == numOfBiggerGroups ? "Yes" : "No");
    }

    private static class FastScanner {
        private final BufferedReader reader;
        private StringTokenizer tokenizer;

        FastScanner(final InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
        }

        String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (final IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }
    }
}
