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.util.Comparator;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Collection;
import java.util.List;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.math.BigInteger;
import java.util.Collections;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author AlexFetisov
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC {

    private int[][][] dp;
    private int numberOfNonLeaves;
    private int numberOfLeaves;
    private int[] counts;
    private int n;
    int[] weights;

    public void solve(int testNumber, InputReader in, PrintWriter out) {
        n = in.nextInt();
        counts = new int[n];
        for (int i = 0; i < n; ++i) {
            counts[i] = in.nextInt() - 1;
        }
        Arrays.sort(counts);
        ArrayUtils.reverse(counts);

        numberOfLeaves = 0;
        for (int i = 0; i < n; ++i) {
            if (counts[i] == 0) {
                ++numberOfLeaves;
            }
        }
        if (n == 1) {
            if (counts[0] == 0) {
                out.println("YES");
            } else {
                out.println("NO");
            }
            return;
        }
        if (2 * numberOfLeaves < n) {
            out.println("NO");
            return;
        }
        if (counts[0] == counts[1]) {
            out.println("NO");
            return;
        }
        numberOfNonLeaves = n - numberOfLeaves;
        dp = new int[numberOfNonLeaves + 1][1 << numberOfNonLeaves][numberOfLeaves + 1];
        weights = new int[1 << numberOfNonLeaves];
        for (int i = 0; i < (1 << numberOfNonLeaves); ++i) {
            weights[i] = 0;
            for (int j = 0; j < numberOfNonLeaves; ++j) {
                if (BitUtils.checkBit(i, j)) {
                    weights[i] += counts[j] + 1;
                }
            }
        }
        ArrayUtils.fill(dp, -1);
        if (rec(0, 1, numberOfLeaves) == 1) {
            out.println("YES");
        } else {
            out.println("NO");
        }
    }

    private int rec(int id, int mask, int numberOfLeaves) {
        if (id == numberOfNonLeaves) {
            if (mask == (1 << numberOfNonLeaves) - 1) {
                if (numberOfLeaves == 0) {
                    return 1;
                }
            }
            return 0;
        }
        if (!BitUtils.checkBit(mask, id)) return 0;
        if (dp[id][mask][numberOfLeaves] != -1) return dp[id][mask][numberOfLeaves];
        dp[id][mask][numberOfLeaves] = 0;
        int res = 0;
        int leftMask = (1 << numberOfNonLeaves) - 1 - mask;
        for (int subSet = leftMask; subSet > 0; subSet = (leftMask & (subSet - 1))) {
            int curChildren = Integer.bitCount(subSet);
            int curWeight = weights[subSet];
            if (counts[id] >= curWeight) {
                int left = counts[id] - curWeight;
                if (numberOfLeaves >= left && left + curChildren > 1) {
                    if (rec(id + 1, mask | subSet, numberOfLeaves - left) == 1) {
                        res = 1;
                        break;
                    }
                }
            }
        }
        int left = counts[id];
        if (numberOfLeaves >= left && left > 1) {
            if (rec(id + 1, mask, numberOfLeaves - left) == 1) {
                res = 1;
            }
        }
        if (res == 1) {
            dp[id][mask][numberOfLeaves] = 1;
            return 1;
        }
        dp[id][mask][numberOfLeaves] = 0;
        return 0;
    }
}

class InputReader {
    private BufferedReader reader;
    private StringTokenizer stt;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
    }

    public String nextLine() {
        try {
            return reader.readLine().trim();
        } catch (IOException e) {
            return null;
        }
    }

    public String nextString() {
        while (stt == null || !stt.hasMoreTokens()) {
            stt = new StringTokenizer(nextLine());
        }
        return stt.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(nextString());
    }

}

class ArrayUtils {

    public static void fill(int[][] f, int value) {
        for (int i = 0; i < f.length; ++i) {
            Arrays.fill(f[i], value);
        }
    }

    public static void fill(int[][][] a, int value) {
        for (int i = 0; i < a.length; ++i) {
            fill(a[i], value);
        }
    }

    public static void reverse(int[] order) {
        for (int i = 0, j = order.length-1; i < j; ++i, --j) {
            int t = order[i];
            order[i] = order[j];
            order[j] = t;
        }
    }

}

class BitUtils {
    public static boolean checkBit(int mask, int bit) {
        return (mask & (1 << bit)) > 0;
    }

}

