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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
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);
        GuessTheTree solver = new GuessTheTree();
        solver.solve(1, in, out);
        out.close();
    }

    static class GuessTheTree {
        ArrayList<State> states = new ArrayList<>();
        ArrayList<State> newState = new ArrayList<>();

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int N = in.nextInt();
            int[] c = new int[N];
            for (int i = 0; i < N; i++) {
                c[i] = in.nextInt();
            }
            Arrays.sort((c = mult(c)));
            c = mult(c);
            int cnt = containsOneN(N, c);
            if (cnt == -1 || cnt >= 12 || c[0] != N) {
                out.println("NO");
                return;
            }
            if (N == 1) {
                out.println("YES");
                return;
            }
            State base = new State(cnt);
            base.need[0] = c[0] - 1;
            newState.add(base);
            for (int i = 1; i < cnt && c[i] != 1; i++) {
                states.clear();
                states.addAll(newState);
                newState.clear();
                for (State st : states) {
                    st.upd(c[i], i);
                }
            }
            if (newState.size() > 0) {
                out.println("YES");
            } else {
                out.println("NO");
            }
        }

        int[] mult(int[] a) {
            int[] next = new int[a.length];
            for (int i = 0; i < a.length; i++) {
                next[i] = a[i] * -1;
            }
            return next;
        }

        int containsOneN(int N, int[] arr) {
            int cnt = 0;
            for (int i : arr) {
                if (i != 1) {
                    cnt++;
                }
                if (i == 2) {
                    return -1;
                }
            }
            return cnt;
        }

        class State {
            int[] need;
            boolean[] done;

            State(int N) {
                need = new int[N];
                done = new boolean[N];
            }

            State(int[] next, boolean[] done) {
                this.need = next;
                this.done = done;
            }

            void upd(int c, int k) {
                for (int i = 0; i < k; i++) {
                    if (done[i]) {
                        if (c <= need[i]) {
                            int[] next = need.clone();
                            boolean[] nextDone = done.clone();
                            next[i] -= c;
                            next[k] = c - 1;
                            newState.add(new State(next, nextDone));
                        }
                    } else {
                        if (c <= need[i] - 1) {
                            int[] next = need.clone();
                            boolean[] nextDone = done.clone();
                            nextDone[i] = true;
                            next[i] -= c;
                            next[k] = c - 1;
                            newState.add(new State(next, nextDone));
                        }
                    }
                }
            }

        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

    }
}

