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;
const int N = 25;
const int M = 1e6 + 3;
int an[100];
int g[N], st[M][N], sm[N], SM[N];
int n, pst, l;
void get(int i, int l) {
  if (i == l) {
    sm[n]++;
    st[pst][0] = g[n];
    for (int j = 1; j < N; ++j) st[pst][j] = sm[j];
    g[n] = pst++;
    sm[n]--;
  } else {
    int j;
    bool ok;
    for (int v = g[an[i]]; v != -1;) {
      for (j = 1; j < N; ++j) sm[j] += st[v][j];
      ok = true;
      for (j = 1; j < N; ++j) ok &= sm[j] <= SM[j];
      if (ok) get(i + 1, l);
      for (j = 1; j < N; ++j) sm[j] -= st[v][j];
      v = st[v][0];
    }
  }
}
void rek(int n, int k, int l) {
  if (!n) {
    if (l == 1) return;
    for (int i = 0; i < N; ++i) sm[i] = 0;
    get(0, l);
    return;
  } else if ((n < 0) || (n < k))
    return;
  an[l] = k;
  rek(n - k, k, l + 1);
  rek(n, k + 1, l);
}
void answer(int n) { rek(n - 1, 1, 0); }
int main() {
  int v, i, c, j;
  bool ok;
  for (i = 0; i < N; ++i) SM[i] = 0;
  scanf("%d", &n);
  for (i = 0; i < n; ++i) {
    scanf("%d", &c);
    ++SM[c];
  }
  for (i = 0; i < N; ++i) g[i] = -1;
  st[0][0] = -1;
  st[0][1] = 1;
  g[1] = 0;
  pst = 1;
  for (n = 3; n < N; ++n) answer(n);
  for (i = 1; i < N; ++i) {
    for (v = g[i]; v != -1;) {
      ok = true;
      for (j = 1; j < N; ++j) ok &= SM[j] == st[v][j];
      if (ok) {
        printf("YES\n");
        return 0;
      }
      v = st[v][0];
    }
  }
  printf("NO\n");
  return 0;
}
