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 inf = 1e9;
const double eps = 1e-9;
const int maxn = 24;
int memo[maxn][1 << (maxn / 2)][maxn];
vector<int> v;
int N;
int f(int node, int mask, int leaves) {
  if (v[node] == 1) {
    return (!mask and !leaves);
  }
  if (mask & (1 << (N - node))) return 0;
  if (memo[node][mask][leaves] != -1) return memo[node][mask][leaves];
  int &ans = memo[node][mask][leaves] = 0;
  vector<int> bits;
  for (int i = 0; i < 30; ++i) {
    if (mask & (1 << i)) bits.push_back(i);
  }
  for (int k = 0; k < (1 << bits.size()); ++k) {
    int m = 0;
    int S = 0;
    int cnt = 0;
    for (int i = 0; i < 30; ++i)
      if (k & (1 << i)) {
        m += (1 << bits[i]);
        S += v[bits[i] + 1];
        ++cnt;
      }
    int L = v[node] - S - 1;
    if (L >= 0 and L <= leaves and L + cnt > 1)
      ans = max(ans, f(node + 1, mask ^ m, leaves - L));
    if (ans) return ans;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  memset(memo, -1, sizeof memo);
  cin >> N;
  v = vector<int>(N);
  int nono = 0;
  for (int i = 0; i < N; ++i) {
    cin >> v[i];
    if (v[i] > 1) ++nono;
  }
  sort(v.rbegin(), v.rend());
  int ans = 0;
  if (N == 1 and v[0] == 1)
    ans = 1;
  else if (N - nono > N / 2)
    ans = f(0, (1 << (max(nono - 1, 0))) - 1, N - nono);
  cout << (ans ? "YES" : "NO") << endl;
}
