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 n;
char dp[24][1 << 16];
char dp2[24][1 << 16][2];
int v[25];
int get(int, int);
int get2(int q1, int mask, int t) {
  if (dp2[q1][mask][t] + 1) return dp2[q1][mask][t];
  ;
  if (mask == 0) {
    if (t) return q1 >= 1;
    return q1 >= 2;
  }
  if (t == 1 && get(q1, mask)) return dp2[q1][mask][t] = 1;
  int qnt = 0, maior = -1;
  for (int i = 0; i < n; i++)
    if (mask & (1 << i)) qnt++;
  if (qnt + q1 == 0) return dp2[q1][mask][t] = 0;
  for (int i = 0; i < n; i++)
    if (mask & (1 << i))
      if (maior == -1 || v[i] > v[maior]) maior = i;
  if (mask == 0 && q1 >= 2) return dp2[q1][mask][t] = 1;
  if (mask == 0) return dp2[q1][mask][t] = 0;
  for (int i = 0; i < (1 << n); i++) {
    if ((mask | i) ^ mask) continue;
    if (i & (1 << maior) == 0) continue;
    for (int j = 0; j <= q1; j++)
      if (get(j, i) && get2(q1 - j, mask ^ i, 1)) return dp2[q1][mask][t] = 1;
  }
  return dp2[q1][mask][t] = 0;
}
int get(int q1, int mask) {
  if (dp[q1][mask] + 1) return dp[q1][mask];
  if (mask == 0 && q1 == 0) return 0;
  if (mask == 0 && q1 == 1) return 1;
  if (mask == 0) return 0;
  ;
  int qnt = 0, maior = -1;
  for (int i = 0; i < n; i++)
    if (mask & (1 << i)) {
      qnt++;
      if (maior == -1 || v[i] > v[maior]) maior = i;
    }
  if (qnt + q1 != v[maior]) return dp[q1][mask] = 0;
  if (qnt == 0) return dp[q1][mask] = 0;
  if (get2(q1, mask ^ (1 << maior), 0))
    return dp[q1][mask] = 1;
  else
    return dp[q1][mask] = 0;
}
bool comp(int a, int b) { return a > b; }
int main() {
  scanf("%d", &n);
  int q1 = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", v + i);
    if (v[i] == 1) q1++;
  }
  if (n - q1 > 15) {
    printf("NO\n");
    return 0;
  }
  sort(v, v + n, comp);
  memset(dp, -1, sizeof(dp));
  memset(dp2, -1, sizeof(dp2));
  n -= q1;
  if (get(q1, (1 << n) - 1))
    printf("YES\n");
  else
    printf("NO\n");
}
