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.Arrays;
import java.util.StringTokenizer;

/**
 * @author Don Li
 */
public class GuessTree {
    
    int m;
    Integer[] sz;
    
    void solve() {
        int n = in.nextInt();
        int[] c = new int[n];
        for (int i = 0; i < n; i++) c[i] = in.nextInt();
        
        int[] cnt = new int[n + 1];
        for (int i = 0; i < n; i++) cnt[c[i]]++;
        
        if (cnt[1] < (n + 1) / 2 || cnt[n] != 1) {
            out.println("NO");
            return;
        }
        
        if (n == 1) {
            out.println("YES");
            return;
        }
        
        m = n - cnt[1];
        sz = new Integer[m];
        for (int i = 0, j = 0; i < n; i++) if (c[i] != 1) sz[j++] = c[i];
        Arrays.sort(sz, (i, j) -> -Integer.compare(i, j));
        
        int bitmask = ((1 << m) - 1) ^ 1;
        boolean ok = dfs(0, bitmask, cnt[1]);
        
        if (ok) out.println("YES");
        else out.println("NO");
    }
    
    boolean dfs(int u, int mask, int rem) {
        
        if (u == m - 1) return mask == 0 && rem == sz[u] - 1 && rem >= 2;
        
        if ((mask & (1 << u)) > 0) return false;
        
        for (int submask = mask; submask > 0; submask = (submask - 1) & mask) {
            int trees = Integer.bitCount(submask), size = 1;
            for (int i = 0; i < m; i++) if ((submask & (1 << i)) > 0) size += sz[i];
            int leafs = sz[u] - size;
            if (leafs < 0 || leafs > rem) continue;
            if (trees + leafs < 2) continue;
            if (dfs(u + 1, mask ^ submask, rem - leafs)) return true;
        }
        
        if (rem - sz[u] + 1 >= 0) {
            if (dfs(u + 1, mask, rem - sz[u] + 1)) return true;
        }
        
        return false;
    }
    
    public static void main(String[] args) {
        in = new FastScanner(new BufferedReader(new InputStreamReader(System.in)));
        out = new PrintWriter(System.out);
        new GuessTree().solve();
        out.close();
    }
    
    static FastScanner in;
    static PrintWriter out;
    
    static class FastScanner {
        BufferedReader in;
        StringTokenizer st;
        
        public FastScanner(BufferedReader in) {
            this.in = in;
        }
        
        public String nextToken() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(in.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        
        public int nextInt() {
            return Integer.parseInt(nextToken());
        }
        
        public long nextLong() {
            return Long.parseLong(nextToken());
        }
        
        public double nextDouble() {
            return Double.parseDouble(nextToken());
        }
    }
}
