Iahub and Iahubina went to a picnic in a forest full of trees. Less than 5 minutes passed before Iahub remembered of trees from programming. Moreover, he invented a new problem and Iahubina has to solve it, otherwise Iahub won't give her the food. 

Iahub asks Iahubina: can you build a rooted tree, such that

  * each internal node (a node with at least one son) has at least two sons; 
  * node i has ci nodes in its subtree? 



Iahubina has to guess the tree. Being a smart girl, she realized that it's possible no tree can follow Iahub's restrictions. In this way, Iahub will eat all the food. You need to help Iahubina: determine if there's at least one tree following Iahub's restrictions. The required tree must contain n nodes.

Input

The first line of the input contains integer n (1 ≤ n ≤ 24). Next line contains n positive integers: the i-th number represents ci (1 ≤ ci ≤ n).

Output

Output on the first line "YES" (without quotes) if there exist at least one tree following Iahub's restrictions, otherwise output "NO" (without quotes). 

Examples

Input

4
1 1 1 4


Output

YES

Input

5
1 1 5 2 1


Output

NO
import java.io.*;
import java.util.*;

public class GuessTheTree {

	BufferedReader br;
	PrintWriter out;
	StringTokenizer st;
	boolean eof;

	boolean solve() throws IOException {
		int n = nextInt();
		int initN = n;
		List<Integer> szList = new ArrayList<>();
		int leaves = 0;

		for (int i = 0; i < n; i++) {
			int x = nextInt();
			if (x == 1) {
				leaves++;
			} else {
				szList.add(x);
			}
		}

		n = szList.size();

		if (leaves <= n) {
			return false;
		}
		
		if (n == 0) {
			return true;
		}

		Collections.sort(szList);
		Collections.reverse(szList);

		int[] sz = new int[n];
		for (int i = 0; i < sz.length; i++) {
			sz[i] = szList.get(i);
		}

		if (sz[0] != initN) {
			return false;
		}

		int[] maskCnt = new int[1 << n];
		int[] maskSum = new int[1 << n];
		for (int i = 0; i < n; i++) {
			maskCnt[1 << i] = 1;
			maskSum[1 << i] = sz[i];
		}

		for (int mask = 1; mask < (1 << n); mask++) {
			int low = Integer.lowestOneBit(mask);
			maskCnt[mask] = maskCnt[low] + maskCnt[mask ^ low];
			maskSum[mask] = maskSum[low] + maskSum[mask ^ low];
		}

		boolean[][][] dp = new boolean[n + 1][leaves + 1][1 << n];
		// current node, unassigned leaves, unassigned nodes

		final int ALL = (1 << n) - 1;

		dp[0][leaves][ALL ^ 1] = true;
		for (int i = 0; i < n; i++) {
			for (int j = 0; j <= leaves; j++) {
				for (int mask = 0; mask < (1 << n); mask++) {
					if (!dp[i][j][mask] || test(mask, i)) {
						continue;
					}
					for (int sub = mask; ; sub = (sub - 1) & mask) {
						int leavesHere = sz[i] - 1 - maskSum[sub];
						if (leavesHere >= 0 && leavesHere <= j
								&& leavesHere + maskCnt[sub] >= 2) {
							dp[i + 1][j - leavesHere][mask ^ sub] = true;
						}
						if (sub == 0) {
							break;
						}
					}
				}
			}
		}

		return dp[n][0][0];

	}

	static boolean test(int mask, int i) {
		return ((mask >> i) & 1) == 1;
	}

	void inp() throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		out.println(solve() ? "YES" : "NO");
		out.close();
	}

	public static void main(String[] args) throws IOException {
		new GuessTheTree().inp();
	}

	String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				eof = true;
				return null;
			}
		}
		return st.nextToken();
	}

	String nextString() {
		try {
			return br.readLine();
		} catch (IOException e) {
			eof = true;
			return null;
		}
	}

	int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}
}
