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.*;
import java.math.BigInteger;
import java.util.Collections.*;
import static java.lang.Math.*;
import static java.lang.Math.max;
import static java.lang.Math.min;
import static java.util.Arrays.*;
import static java.math.BigInteger.*;


public class Main{

    void run(){
        Locale.setDefault(Locale.US);
        boolean my;
        try {
            my = System.getProperty("MY_LOCAL") != null;
        } catch (Exception e) {
            my = false;
        }
        try{
            err = System.err;
            if( my ){
                sc  = new FastScanner(new BufferedReader(new FileReader("input.txt")));
//                sc  = new FastScanner(new BufferedReader(new FileReader("C:\\myTest.txt")));
                out = new PrintWriter   (new FileWriter("output.txt"));
            }
            else {
                sc = new FastScanner(new BufferedReader(new InputStreamReader(System.in)));
                out = new PrintWriter(new OutputStreamWriter(System.out));
            }
//            out = new PrintWriter(new OutputStreamWriter(System.out));
        }catch(Exception e){
            MLE();
        }
        if( my )
            tBeg = System.currentTimeMillis();
        solve();
        if( my )
            err.println( "TIME: " + (System.currentTimeMillis() - tBeg ) / 1e3 );
        exit(0);
    }

    void exit( int val ){
        err.flush();
        out.flush();
        System.exit(val);
    }

    double tBeg;
    FastScanner sc;
    PrintWriter out;
    PrintStream err;

    class FastScanner{

        StringTokenizer st;
        BufferedReader br;

        FastScanner( BufferedReader _br ){
            br = _br;
        }

        String readLine(){
            try {
                return br.readLine();
            } catch (IOException e) {
                return null;
            }
        }

        String next(){
            while( st==null || !st.hasMoreElements() )
                st = new StringTokenizer(readLine());
            return st.nextToken();
        }

        int nextInt(){ return Integer.parseInt(next()); }
        long nextLong(){ return Long.parseLong(next()); }
        double nextDouble(){ return Double.parseDouble(next()); }
    }

    void MLE(){
        int[][] arr = new int[1024*1024][]; for( int i = 0; i < 1024*1024; ++i ) arr[i] = new int[1024*1024];
    }

    void MLE( boolean doNotMLE ){ if( !doNotMLE ) MLE(); }

    void TLE(){
        for(;;);
    }

    public static void main(String[] args) {
        new Main().run();
//        new Thread( null, new Runnable() {
//            @Override
//            public void run() {
//                new Main().run();
//            }
//        }, "Lolka", 256_000_000L ).run();
    }

    ////////////////////////////////////////////////////////////////


    int n, cntLeaf, cntInter;
    int[] c, sumC;

    void solve(){
        {
            ArrayList<Integer> arr = new ArrayList<>();
            n = sc.nextInt();
            for (int it = 0; it < n; it++) {
                int cur = sc.nextInt();
                if( cur != 1 ){
                    arr.add( cur );
                }
            }
            c = new int[arr.size()];
            for (int i = 0; i < arr.size(); i++) {
                c[i] = arr.get(i);
            }
            cntLeaf = n - c.length;
            cntInter = c.length;
        }

        if( cntInter == 0 ){
            out.println( n == 1? "YES" : "NO");
            return;
        }

        if( 12 <= cntInter ){
            out.println( "NO");
            return;
        }

        sort( c );
        for (int i = 0, j = c.length-1; i < j; i++, j--) {
            int t = c[i]; c[i] = c[j]; c[j] = t;
        }

        sumC = new int[1<<cntInter];
        for (int msk = 0; msk < (1 << cntInter); msk++) {
            for (int j = 0; j < cntInter; j++) {
                if( ((1<<j)&msk) != 0 )
                    sumC[msk] += c[j];
            }
        }

        boolean[][] tree0 = new boolean[1<<cntInter][cntLeaf+1];
        tree0[1][cntLeaf] = true;

        for (int i = 0; i < cntInter; i++) {
            boolean[][] tree1 = new boolean[1<<cntInter][cntLeaf+1];
            for (int msk = 0; msk < (1 << cntInter); msk++) {
                for (int leaf = 0; leaf <= cntLeaf; leaf++) {
                    if( !tree0[msk][leaf] ) continue;

                    int allChildren = 0;
                    for (int j = 0; j < cntInter; j++)
                        if( ((1<<j)&msk) == 0 )
                            allChildren |= 1<<j;

                    for (int mskChildren = allChildren;
                         ;
                         mskChildren = allChildren & (mskChildren-1))
                    {

                        int sum = sumC[mskChildren];
                        if( sum <= c[i]-1 ){
                            int cntJoinLeaf = c[i] - 1 - sum;
                            if( 0 <= leaf - cntJoinLeaf &&
                                    2 <= cntJoinLeaf + Integer.bitCount(mskChildren) )
                                tree1[msk | mskChildren][leaf - cntJoinLeaf] = true;
                        }
                        if( mskChildren == 0 ) break;
                    }
                }
            }
            //
            tree0 = tree1;
        }
        out.println( tree0[(1<<cntInter)-1][0]? "YES" : "NO" );
    }


}