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.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.StringTokenizer;

public class C {
	static ArrayList<Integer> subTrees;
	static int[][][] dp;

	public static int solve(int mask, int idx, int remOnes) {
		if (idx == -1) {
			if (remOnes == 0 && mask == 0) {
				return 1;
			}
			return 0;
		}
		if((mask|(1<<idx))==mask){
			return 0;
		}
		if (dp[mask][idx][remOnes] != -1)
			return dp[mask][idx][remOnes];
		int needed = subTrees.get(idx) - 1;
		int res = 0;
		for (int m = mask; m != 0; m = mask & (m - 1)) {
			int tmp = 0;
			for (int i = 0; i < subTrees.size(); i++) {
				if (((1 << i) | m) == m) {
					tmp += subTrees.get(i);
				}
			}
			if (tmp <= needed && needed - tmp <= remOnes &&  Integer.bitCount(m)+(needed-tmp)>=2) {
				res = Math.max(res,
						solve(mask ^ m, idx - 1, remOnes - (needed - tmp)));
			}
		}
//		System.out.println(Integer.toBinaryString(mask)+" a7a"+idx+" "+remOnes+" "+res);
		if (remOnes >= needed && needed>=2) {
			res = Math.max(res, solve(mask, idx - 1, remOnes - needed));
		}
//		System.out.println(Integer.toBinaryString(mask)+" "+idx+" "+remOnes+" "+res);
		return dp[mask][idx][remOnes]=res;
	}

	public static void main(String[] args) throws Exception {
//		int r=(1<<4)-1;
//		for(int t=r;t!=0;t=r&(t-1)){
//			System.out.println(Integer.toBinaryString(t));
//		}
		int n = nextInt(), oneCnt = 0;
		subTrees = new ArrayList<>();
		for (int i = 0; i < n; i++) {
			int x = nextInt();
			if (x == 1) {
				oneCnt++;
			} else {
				subTrees.add(x);
			}
		}
		if(subTrees.size()>oneCnt){
			System.out.println("NO");
			return;
		}else if(subTrees.size()==0) {
			if(oneCnt==1){
				System.out.println("YES");
			}else{
				System.out.println("NO");
			}
			return;
		}
		Collections.sort(subTrees);
		dp = new int[(1 << (subTrees.size() - 1))][subTrees.size()][oneCnt + 1];
		for (int i = 0; i < dp.length; i++) {
			for (int j = 0; j < dp[i].length; j++)
				Arrays.fill(dp[i][j], -1);
		}

		if (solve((1 << (subTrees.size() - 1)) - 1, subTrees.size() - 1, oneCnt) > 0) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}

	static BufferedReader br = new BufferedReader(new InputStreamReader(
			System.in));
	static StringTokenizer tokenizer = new StringTokenizer("");

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

	static double nextDouble() throws Exception {
		return Double.parseDouble(next());
	}

	static String next() throws Exception {
		while (true) {
			if (tokenizer.hasMoreTokens()) {
				return tokenizer.nextToken();
			}
			String s = br.readLine();
			if (s == null) {
				return null;
			}
			tokenizer = new StringTokenizer(s);
		}
	}
}
