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


public class Main {
	static int N,internal,leafs;
	static int [] c;
	static int [][][] dp;
	final static String Y = "YES";
	final static String X = "NO";
	
	
	static int dp(int index,int mask,int leaves){
		if(c[index] == 1 && mask == (1<<internal)-1 && leaves == 0) return 1;
		if(c[index] == 1 && (mask!= (1<<internal) -1 || leaves > 0) ) return 0;
		if(c[index]!=1 && ((mask & 1<<index) ==0 || leaves == 0)) return 0;
		
		if(dp[index][mask][leaves]!=-1) return dp[index][mask][leaves];
		
		int subMask = 0; int answer = 0;
		
		for(int i=0;i<Math.pow(2, internal);i++) {
			int S = 0;
			int count = 0;
				subMask = i ;
				for(int j=0;j<internal;j++) 
					if((1<<j & subMask) != 0 && (1<<j & mask) == 0) {
						S+= c[j]; count++;
					}
			

				if(c[index] - S -1 >=0 && leaves>= c[index]-S-1 && (count+ (c[index]-S-1))>=2 )
					answer = Math.max(answer, dp(index+1, mask | subMask, leaves- (c[index]-S-1)));
				
		}
		return dp[index][mask][leaves] = answer;
		
	}
	private static void solve() {
		N = nextInt();
		c = new int [N];
		leafs = 0;
		ArrayList<Integer> cR = new ArrayList<Integer>();
		for(int i=0;i<N;i++) {
			cR.add(nextInt());
			if(cR.get(i) == 1) leafs++;
		}
		internal = N-leafs;
		if(N == 1 && cR.get(0) == 1) {out.println("YES"); return ;}
		if(leafs < (N+1)/2) {out.println("NO"); return;}
		
		
		dp = new int[N][1<<internal][leafs+1];
		for(int i = 0;i<dp.length;i++)
			for(int j=0;j<dp[i].length;j++)
				for(int k=0;k<dp[i][j].length;k++)
					dp[i][j][k] = -1;
		
		Collections.sort(cR);
		Collections.reverse(cR);
		
		for(int i=0;i<cR.size();i++)
			c[i] = cR.get(i);
		
		out.println(dp(0, 1<<0, leafs)==0?  X:Y);
		
		
	
		
		
		
		
	}
	
    private static void run() {
        br = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);

        solve();

        out.close();
    }

    private static StringTokenizer st;
    private static BufferedReader br;
    private static PrintWriter out;

    private static String next() {
        while (st == null || !st.hasMoreElements()) {
            String s;
            try {
                s = br.readLine();
            } catch (IOException e) {
                return null;
            }
            st = new StringTokenizer(s);
        }
        return st.nextToken();
    }

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

    private static long nextLong() {
        return Long.parseLong(next());
    }

    public static void main(String[] args) {
        run();
    }
}
