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.*;

public class C {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    n = in.nextInt();
    int[] A2 = new int[n];
    for(int i=0; i<n; i++)
      A2[i] = in.nextInt();
    Arrays.sort(A2);
    A = new int[n];
    for(int i=0; i<n; i++)
      A[i] = A2[n-1-i];

    if(n==1) {
      System.out.println(A[0] == 1 ? "YES": " NO");
      return;
    }

    List<Integer> N2 = new ArrayList<Integer>();
    List<Integer> N1 = new ArrayList<Integer>();
    List<Integer> N0 = new ArrayList<Integer>();
    N2.add(A[0]-1);

    boolean ans = can(1, N2, N1, N0);
    System.out.println(ans ? "YES" : "NO");
  }

  static int n;
  static int[] A;
  static boolean can(int i, List<Integer> N2, List<Integer> N1, List<Integer> N0) {
    if(i==n && N2.isEmpty() && N1.isEmpty() && N0.isEmpty()) return true;
    if(2*N2.size() + N1.size() > n-i) return false;
    if(A[i] == 1) return put_leaves(n-i, N2, N1, N0);

    for(Integer n2 : N2) {
      if(n2 > A[i]) {
        List<Integer> NN2 = new ArrayList<Integer>(N2);
        List<Integer> NN1 = new ArrayList<Integer>(N1);
        NN2.remove(n2);
        NN1.add(n2-A[i]);
        NN2.add(A[i]-1);
        if(can(i+1, NN2, NN1, N0)) return true;
      }
    }
    for(Integer n1 : N1) {
      if(n1 >= A[i]) {
        List<Integer> NN2 = new ArrayList<Integer>(N2);
        List<Integer> NN1 = new ArrayList<Integer>(N1);
        List<Integer> NN0 = new ArrayList<Integer>(N0);
        NN1.remove(n1);
        NN2.add(A[i]-1);
        if(n1 > A[i]) {
          NN0.add(n1-A[i]);
        }
        if(can(i+1, NN2, NN1, NN0)) return true;
      }
    }
    for(Integer n0 : N0) {
      if(n0 >= A[i]) {
        List<Integer> NN2 = new ArrayList<Integer>(N2);
        List<Integer> NN0 = new ArrayList<Integer>(N0);
        NN0.remove(n0);
        if(n0 > A[i]) {
          NN0.add(n0-A[i]);
        }
        NN2.add(A[i]-1);
        if(can(i+1, NN2, N1, NN0)) return true;
      }
    }
    return false;
  }

  static boolean put_leaves(int leaves, List<Integer> N2, List<Integer> N1, List<Integer> N0) {
    for(Integer n2 : N2)
      if(n2==1) return false;

    int sum = 0;
    for(Integer n2 : N2) sum += n2;
    for(Integer n1 : N1) sum += n1;
    for(Integer n0 : N0) sum += n0;
    return sum == leaves;
  }
}
