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

public class C {
    static int[] nodes;
    static int[] sums;
    static int[][][] dp;

    public static int f(int i, int mask, int ones) {
        if (i == nodes.length)
            return ones == 0 ? 1 : 0;
        if ((mask & (1 << i)) == 0)
            return 0;
        if (ones < 0)
            return 0;
        if (dp[i][ones][mask] != -1)
            return dp[i][ones][mask];
        int left = (mask) ^ ((1 << nodes.length) - 1);
        int need = nodes[i] - 1;
        int result = 0;
        for (int j = left; j >= 0 && result == 0; j = (j - 1) & left) {
            if (need >= sums[j]) {
                int total = (need - sums[j]) + Integer.bitCount(j);
                if (total >= 2)
                    result |= f(i + 1, mask | j, ones - (need - sums[j]));
            }
            if (j == 0)
                break;
        }
        return dp[i][ones][mask] = result;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] deg = new int[n];
        for (int i = 0; i < n; i++)
            deg[i] = in.nextInt();
        if (n == 1) {
            if (deg[0] == 1)
                System.out.println("YES");
            else
                System.out.println("NO");
            return;
        }
        Arrays.sort(deg);
        int ones = 0;
        for (int i : deg)
            if (i == 1)
                ones++;
        if (ones <= n - ones)
            System.out.println("NO");
        else {
            nodes = new int[n - ones];
            for (int i = 0; i < nodes.length; i++) {
                nodes[i] = deg[n - 1 - i];
            }
            sums = new int[1 << nodes.length];
            for (int i = 0; i < sums.length; i++) {
                for (int j = 0; j < nodes.length; j++)
                    if ((i & (1 << j)) != 0) {
                        sums[i] += nodes[j];
                    }
            }
            dp = new int[13][26][1 << 13];
            for (int[][] a : dp)
                for (int[] b : a)
                    Arrays.fill(b, -1);
            int result = f(0, 1, ones);
            if (result == 1)
                System.out.println("YES");
            else
                System.out.println("NO");
        }
    }
}
