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>
#pragma GCC optimize("Ofast")
#pragma GCC target( \
    "avx,avx2,fma,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
int MOD = 1e9 + 7;
vector<int> c;
int kol = 0;
int n;
vector<int> num[25];
void dfs(int m) {
  if (m == n - 1) {
    int kl = kol;
    for (int i = n - 1; i > -1; i--) {
      if (c[i] > 1) {
        int kek = 0;
        int num1 = 0;
        for (auto j : num[i]) {
          kek += c[j];
          num1++;
        }
        num1 += c[i] - 1 - kek;
        if (kek <= c[i] - 1) {
          kl -= c[i] - 1 - kek;
        } else {
          return;
        }
        if (num1 < 2) {
          return;
        }
      }
    }
    if (kl == 0) {
      cout << "YES";
      exit(0);
    }
    return;
  }
  for (int i = m + 1; i < n; i++) {
    num[i].push_back(m);
    dfs(m + 1);
    num[i].pop_back();
  }
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0),
      cout << fixed << setprecision(20);
  cin >> n;
  c.resize(n);
  int sm = 0;
  for (int i = 0; i < n; i++) {
    cin >> c[i];
    sm = max(sm, c[i]);
    if (c[i] == 1) kol++;
  }
  if (n - kol > 11 || sm != n) {
    cout << "NO";
    return 0;
  }
  sort(c.begin(), c.end());
  int nw = 0;
  while (nw < n && c[nw] == 1) nw++;
  if (nw == n) {
    cout << "YES";
    return 0;
  }
  dfs(nw);
  cout << "NO";
}
