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.lang.reflect.Array;
import java.util.*;

/**
 * Created by noureldin on 2/20/17.
 */

public class main {

    private static Boolean [][][] dp = new Boolean[13][1 << 11][25];
    private static int [] siz ,A;
    private static int n,m;

    private static boolean solve(int cur,int msk,int leafs){
        if(cur == siz.length) return leafs == 0;
        if((msk & (1 << cur)) == 0) return false;
        if (dp[cur][msk][leafs] != null) return dp[cur][msk][leafs];
        dp[cur][msk][leafs] = false;
        ArrayList<Integer> R = new ArrayList<>();
        for (int i = 0;i < siz.length;i++)
            if((msk & (1 << i)) == 0)
                R.add(i);
        for (int tmsk = 0;tmsk < (1 << R.size()) && !dp[cur][msk][leafs];tmsk++){
            int nmsk = msk,ctr = 1,ctr2 = 0;
            for (int i = 0;i < siz.length;i++)
                if((tmsk & (1 << i)) != 0){
                    int j = R.get(i);
                    nmsk |= 1 << j;
                    ctr += siz[j];
                    ctr2++;
                }
            if(ctr <= siz[cur] && siz[cur] - ctr <= leafs) {
                ctr2 += siz[cur] - ctr;
                if (ctr2 >= 2)
                    dp[cur][msk][leafs] = solve(cur + 1, nmsk, leafs - (siz[cur] - ctr));
            }
        }
        return dp[cur][msk][leafs];
    }
    public static void main(String[] args) throws Exception{
        IO io = new IO(null,null);
        n = io.getNextInt();
        m = 0;
        A = new int[n];
        for (int i = 0;i < n;i++) {
            A[i] = io.getNextInt();
            if (A[i] == 1) m++;
        }
        if(n == 1){
            if(m == 1) io.println("YES");
            else io.println("NO");
        }
        else if(m < (n + 2)/2 || n == m) {
            io.println("NO");
        }
        else {
            siz = new int[n - m];
            m = 0;
            for (int i = 0;i < n;i++)
                if(A[i] != 1)
                    siz[m++] = A[i];
            Arrays.sort(siz);
            for (int i = 0; 2 * i < siz.length; i++) {
                int x = siz[i], y = siz[siz.length - 1 - i];
                siz[i] = y;
                siz[siz.length - 1 - i] = x;
            }
            io.println(solve(0,1,n - m) ? "YES" : "NO");
        }
        io.close();
    }
}




class IO{
    private BufferedReader br;
    private StringTokenizer st;
    private PrintWriter writer;
    private String inputFile,outputFile;

    public String getNext() throws FileNotFoundException, IOException{
        while(st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }

    public String getNextLine() throws FileNotFoundException, IOException{
        return br.readLine();
    }

    public int getNextInt() throws FileNotFoundException, IOException{
        return Integer.parseInt(getNext());
    }
    public long getNextLong() throws FileNotFoundException, IOException{
        return Long.parseLong(getNext());
    }

    public void print(double x,int num_digits) throws  IOException{
        writer.printf("%." + num_digits + "f" ,x);
    }
    public void println(double x,int num_digits) throws  IOException{
        writer.printf("%." + num_digits + "f\n" ,x);
    }
    public void print(Object o) throws  IOException{
        writer.print(o.toString());
    }

    public void println(Object o) throws  IOException{
        writer.println(o.toString());
    }
    public IO(String x,String y) throws FileNotFoundException, IOException{
        inputFile = x;
        outputFile = y;
        if(x != null) br = new BufferedReader(new FileReader(inputFile));
        else br = new BufferedReader(new InputStreamReader(System.in));
        if(y != null) writer = new PrintWriter(new BufferedWriter(new FileWriter(outputFile)));
        else writer = new PrintWriter(new OutputStreamWriter(System.out));
    }

    protected void close() throws IOException{
        br.close();
        writer.close();
    }
}