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.math.BigInteger;
import java.util.*;
import java.util.List;
import java.util.regex.Matcher;

public class Main {
    private static StringTokenizer st;
    private static BufferedReader br;
    public static long MOD = 1000000007;

    private static List<List<Integer>>[] ways;

    public static void print(Object x) {
        System.out.println(x + "");
    }
    public static void printArr(long[] x) {
        StringBuilder s = new StringBuilder();
        for (int i = 0; i < x.length; i++) {
            s.append(x[i] + " ");
        }
        print(s);
    }
    public static void printArr(int[] x) {
        StringBuilder s = new StringBuilder();
        for (int i = 0; i < x.length; i++) {
            s.append(x[i] + " ");
        }
        print(s);
    }
    public static String join(Collection<?> x, String space) {
        if (x.size() == 0) return "";
        StringBuilder sb = new StringBuilder();
        boolean first = true;
        for (Object elt : x) {
            if (first) first = false;
            else sb.append(space);
            sb.append(elt);
        }
        return sb.toString();
    }

    public static String nextToken() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            String line = br.readLine();
            st = new StringTokenizer(line.trim());
        }
        return st.nextToken();
    }
    public static int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }
    public static long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }
    public static List<Integer> nextInts(int N) throws IOException {
        List<Integer> ret = new ArrayList<Integer>();
        for (int i = 0; i < N; i++) {
            ret.add(nextInt());
        }
        return ret;
    }

    public static List<List<Integer>> waysFor(int minSize, int totalSize, boolean start) {
        List<List<Integer>> result = new ArrayList<List<Integer>>();
        if (totalSize == 0) {
            if (!start) result.add(new ArrayList<Integer>());
            return result;
        }

        //print("Min " + minSize + " total " + totalSize);
        for (int min = minSize; min <= totalSize; min++) {
            if (start && min == totalSize) continue;
            //print("Trying min " + min);
            for (List<Integer> makeMin : ways[min]) {
                for (List<Integer> makeRest : waysFor(min, totalSize - min, false)) {
                    List<Integer> way = new ArrayList<Integer>(makeMin);
                    way.addAll(makeRest);
                    result.add(way);
                }
            }
        }
        if (start)
            for (List<Integer> way : result)
                way.add(totalSize + 1);
        return result;
    }

    public static String solve(List<Integer> input, int MAX) {
        ways = new List[MAX + 1];
        for (int i = 1; i <= MAX; i++) ways[i] = new ArrayList<List<Integer>>();
        ways[1].add(Arrays.asList(1));
        for (int i = 3; i <= MAX; i++) {
            ways[i] = waysFor(1, i - 1, true);
            ways[i] = filter(input, ways[i]);
            //print(ways[i].size());
        }

        for (List<Integer> way : ways[MAX]) {
            Collections.sort(way);
            if (way.equals(input)) return "YES";
        }

        return "NO";
    }

    public static Map<Integer, Integer> count(List<Integer> input) {
        Map<Integer, Integer> result = new HashMap<Integer, Integer>();
        for (int x : input) {
            if (!result.containsKey(x)) result.put(x, 0);
            result.put(x, result.get(x) + 1);
        }
        return result;
    }

    public static List<List<Integer>> filter(List<Integer> target, List<List<Integer>> candidates) {
        List<List<Integer>> result = new ArrayList<List<Integer>>();
        Map<Integer, Integer> targetMap = count(target);
        outer : for (List<Integer> candidate : candidates) {
            for (Map.Entry<Integer, Integer> kv : count(candidate).entrySet()) {
                int x = kv.getKey();
                if (!targetMap.containsKey(x)) continue outer;
                if (targetMap.get(x) < kv.getValue()) continue outer;
            }
            result.add(candidate);
        }
        return result;
    }

    public static void main(String[] args) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));

        int MAX = nextInt();
        List<Integer> input = nextInts(MAX);
        Collections.sort(input);
        print(solve(input, MAX));
    }
}
