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
#include <bits/stdc++.h>
using namespace std;
int i, j, m, n, p, k, N, leaf, sum[10005], size[10005];
int c[25];
bool f[14][10005][14];
inline bool cmp(int a, int b) { return a > b; }
void dfs(int x, int y, int z) {
  int i;
  for (i = 0; i < (1 << N); ++i)
    if (!(y & i)) {
      int le = c[x] - sum[i] - 1;
      if (le >= 0 && le <= z && le + size[i] > 1) f[x][y | i][z - le] = 1;
    }
}
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; ++i) scanf("%d", &c[i]);
  sort(c + 1, c + n + 1, cmp);
  for (i = 1; i <= n; ++i)
    if (c[i] == 1) break;
  N = i - 1;
  leaf = n - N;
  if (n == 1 && leaf == 1)
    printf("YES\n");
  else if (leaf == n || leaf < (n + 1) / 2)
    printf("NO\n");
  else {
    for (i = 0; i < (1 << N); ++i)
      for (j = 0; j < N; ++j)
        if (i & (1 << j)) sum[i] += c[j + 1], size[i]++;
    f[0][1][leaf] = 1;
    for (i = 0; i < N; ++i)
      for (j = 0; j < (1 << N); ++j)
        for (k = 0; k <= leaf; ++k)
          if (f[i][j][k]) dfs(i + 1, j, k);
    if (f[N][(1 << N) - 1][0])
      printf("YES\n");
    else
      printf("NO\n");
  }
}
