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.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.NoSuchElementException;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws FileNotFoundException {
		new Main().run();
	}

	void run() {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n];
		int ma = -(Integer.MAX_VALUE >> 4);
		int mi = Integer.MAX_VALUE >> 4;
		for (int i = 0; i < n; ++i) {
			a[i] = sc.nextInt();
			ma = Math.max(ma, a[i]);
			mi = Math.min(mi, a[i]);
		}
		int cnt_ma = 0, cnt_mi = 0;
		for (int i = 0; i < n; ++i) {
			if (ma == a[i]) {
				++cnt_ma;
			} else {
				++cnt_mi;
			}
		}
		if (ma - 1 != mi && ma != mi) {
			System.out.println("No");
			return;
		}
		if (ma == mi && ma == n - 1) {
			System.out.println("Yes");
			return;
		}
		int v = ma - (ma == mi ? 0 : cnt_mi);
		if (1 <= v && v <= cnt_ma / 2) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}

	void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}
}
