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 dp[24][4097];
int c[24];
int a[12];
int bit[12];
int pow2[24];
int printflag = 0;
int can(vector<int> &z, int sum, int s, int n, int val, int l, int ch) {
  if (s == n) {
    if (sum > l) return 0;
    if (ch + sum < 2) return 0;
    return dp[l - sum][val];
  }
  int y2 = can(z, sum, s + 1, n, val, l, ch);
  val = val + pow2[z[s]];
  sum = sum - a[z[s]];
  int y1 = can(z, sum, s + 1, n, val, l, ch + 1);
  return y1 | y2;
}
int main() {
  pow2[0] = 1;
  for (int i = 1; i < 24; i++) pow2[i] = 2 * pow2[i - 1];
  memset(dp, 0, sizeof dp);
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &c[i]);
  }
  if (n == 1 && c[0] == 1) {
    printf("YES\n");
    return 0;
  }
  sort(c, c + n);
  int l = 0;
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    if (c[i] == 1)
      l++;
    else {
      a[cnt++] = c[i];
    }
  }
  n = cnt;
  if (n > 12) {
    printf("NO\n");
    return 0;
  }
  if (n == 0) {
    printf("NO\n");
    return 0;
  }
  for (int j = 0; j <= l; j++) {
    for (int i = 1; i < (1 << n); i++) {
      if (j == l && i == pow2[n - 1]) {
        printflag = 1;
      }
      memset(bit, 0, sizeof bit);
      int cnt = 0;
      int val = i;
      while (val > 0) {
        bit[cnt++] = val & 1;
        val = val / 2;
      }
      int idx;
      for (int k = 0; k < n; k++) {
        if (bit[k] == 1) {
          idx = k;
        }
      }
      val = i;
      val = val - pow2[idx];
      if (idx == 0) {
        if (a[idx] - 1 == j && j > 1) {
          dp[j][i] = 1;
        } else
          dp[j][i] = 0;
        continue;
      }
      int ch = 0;
      int sum = 1;
      if (bit[idx - 1] == 0) {
        ch = 1;
        val = val + pow2[idx - 1];
        sum = sum + a[idx - 1];
      }
      if (sum > a[idx]) continue;
      vector<int> z;
      for (int k = 0; k < idx - 1; k++) {
        if (bit[k] == 0) z.push_back(k);
      }
      int len = z.size();
      dp[j][i] = can(z, a[idx] - sum, 0, len, val, j, ch);
    }
  }
  if (dp[l][pow2[n - 1]]) {
    printf("YES\n");
  } else {
    printf("NO\n");
  }
}
