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.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashMap;


public class E {
    
    static int MAX_BITS=24;
    
    String to_key(int[] q) {
        StringBuilder sb=new StringBuilder();
        for (int i=0; i<q.length; i++) {
            sb.append("/"+(ccnt[i]+"-"+q[i]));
        }
        return sb.toString();
    }
    
    int max(int[] q) {
        for (int i=q.length-1; i>=0; i--) {
            if(q[i]>0) {
                return i;
            }
        }
        return -1;
    }

    int cnt(int[] q) {
        int ret=0;
        for (int i=0; i<q.length; i++) {
            if(q[i]>0) {
                ret++;
            }
        }
        return ret;
    }
    
    int sum(int[] q) {
        int ret=0;
        for (int i=0; i<q.length; i++) {
            ret+=q[i];
        }
        return ret;
    }

    int N;
    int[] ccnt;
    HashMap<String, Integer> memo=new HashMap<String, Integer>();
    
    int max_trees(final int[] q) {
        String key=to_key(q);
        if(memo.containsKey(key)) {
            return memo.get(key);
        }

        int set_size=cnt(q);
        if(set_size==0) {
            return 0;
        } else if (set_size==1) {
            int i=max(q);
            int ret=ccnt[i]==1? q[i]: 0;
            return ret;
        }
        
        final int root=max(q);
        if(ccnt[root]>sum(q)) {
            return 0;
        }
        q[root]--;
        
        int[] from=new int[N], to=new int[N];
        final int[] new_q1=new int[N], new_q2=new int[N];
        
        for (int i=0; i<N; i++) {
            to[i]=q[i];
        }
        
        final int[] ret=new int[1];
        loop(from, to, ccnt[root]-1, new Callback() {
            @Override
            public boolean callback(int[] values) {
                if(sum(values)==ccnt[root]-1) {
                    //System.out.println(Arrays.toString(values));
                    for (int i=0; i<N; i++) {
                        new_q1[i]=values[i];
                        new_q2[i]=q[i]-values[i];
                    }
                    int tcnt1=max_trees(new_q1);
                    int tcnt2=max_trees(new_q2);
                    if((sum(new_q1)==0||tcnt1>1)&&(sum(new_q2)==0||tcnt2>0)/*valid subtree?*/) {
                        if(ret[0]<tcnt2+1) {
                            ret[0]=tcnt2+1;
                            if(ret[0]>1) {
                                return false;
                            }
                        }
                    }
                }
                return true;
            }
        });
        memo.put(key, ret[0]);
        return ret[0];
    }
    
    boolean solve(int[] ccnt) {
        if(ccnt.length==1) {
            return ccnt[0]==1;
        }
        Arrays.sort(ccnt);
        HashMap<Integer, Integer> remap=new HashMap<Integer, Integer>();
        for (int i=0; i<ccnt.length; i++) {
            /*if(ccnt[i]==2) {
                return false;
            }*/
            if(!remap.containsKey(ccnt[i])) {
                remap.put(ccnt[i], remap.size());
            }
        }
        N=remap.size();

        this.ccnt=new int[N];
        for (int i=0; i<ccnt.length; i++) {
            this.ccnt[remap.get(ccnt[i])]=ccnt[i];
        }
        int[] q=new int[N];
        for (int i=0; i<ccnt.length; i++) {
            int j=remap.get(ccnt[i]);
            q[j]++;
        }
        
        //System.out.println(Arrays.toString(ccnt));
        if(sum(q)!=this.ccnt[N-1]) {
            return false;
        } else {
            q[N-1]--;
            boolean ret=max_trees(q)>=2;
            return ret;
        }
    }

    public interface Callback {
        boolean callback(int[] values);
    }
    
    public static void loop(int[] from, int[] to, int sum, Callback c) {
        int N=from.length;
        int[] v=new int[N], max=new int[N];
        int sum2=sum;
        for (int i=0; i<N&&sum2>0; i++) {
            v[i]=Math.min(sum2, to[i]);
            sum2-=v[i];
        }
        sum2=sum;
        for (int i=N-1; i>=0&&sum2>0; i--) {
            max[i]=Math.min(sum2, to[i]);
            sum2-=max[i];
        }
        
        while(true) {
            if(!c.callback(v)) {
                break;
            }
            if(Arrays.equals(v, max)) {
                break;
            }

            int i=0;
            for (int j=-1; i<N&&v[i]==to[i]||j<0; i++) {
                if(v[i]>0) {
                    j=i;
                }
            }
            
            v[i]++; sum2=0;
            for (int j=0; j<i; j++) {
                sum2+=v[j];
            }
            sum2--;
            for (int j=0; j<i&&sum2>=0; j++) {
                v[j]=Math.min(sum2, to[j]);
                sum2-=v[j];
            }
        }
    }

    public static void loop(int[] from, int[] to, Callback c) {
        int n=from.length;
        int[] v=from.clone();
        long[] products=new long[n];
        for (int i=0; i<n; i++) {
            products[i]=to[i]-from[i]+1;
            if(i>0) {
                products[i]*=products[i-1];
            }
        }
        
        for (long i=0; i<products[n-1]; i++) {
            long k=i;
            for (int j=n-1; j>=1; j--) {
                v[j]=from[j]+(int)(k/products[j-1]);
                k%=products[j-1];
            }
            v[0]=from[0]+(int)k;
            if(!c.callback(v)) {
                break;
            }
        }
    }

    
    
    static StringBuilder sb=new StringBuilder();
    static void parse(String l, int[] here) {
        sb.setLength(0);
        int len=l.length(), j=0;
        for (int i=0; i<len; i++) {
            char c=l.charAt(i);
            if(c==' ') {
                here[j++]=Integer.parseInt(sb.toString());
                sb.setLength(0);
            } else {
                sb.append(c);
            }
        }
        if(sb.length()>0) {
            here[j++]=Integer.parseInt(sb.toString());
        }
    }
    
    static void run_stream(InputStream ins) throws IOException {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        int N=Integer.parseInt(br.readLine());
        int[] ccnt=new int[N];
        parse(br.readLine(), ccnt);
        
        E e=new E();
        long t0=System.currentTimeMillis();
        boolean ret=e.solve(ccnt);
        System.out.println(ret? "YES": "NO");
        //System.out.println(System.currentTimeMillis()-t0);
    }

    public static void main(String[] args) throws IOException {
        run_stream(System.in);
    }

}
