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 nos[32], N;
bool dfs(int idx, map<int, int> m);
bool dfs2(int idx, int tot, int cidx, vector<pair<int, int> > &curr,
          map<int, int> m);
bool dfs(int idx, map<int, int> m) {
  if (idx == N) {
    int tot = 0;
    for (auto p : m) tot += p.second;
    if (tot == 1) return true;
    return false;
  }
  vector<pair<int, int> > curr;
  for (auto p : m)
    if (p.second > 0) curr.push_back(p);
  reverse(curr.begin(), curr.end());
  if (dfs2(idx, 0, 0, curr, m)) return true;
  return false;
}
bool dfs2(int idx, int tot, int cidx, vector<pair<int, int> > &curr,
          map<int, int> m) {
  if (tot >= nos[idx]) return false;
  if (tot + 1 == nos[idx]) {
    m[nos[idx]] += 1;
    if (dfs(idx + 1, m)) return true;
    m[nos[idx]] -= 1;
    return false;
  }
  if (cidx < curr.size()) {
    for (int i = curr[cidx].second; i >= 0; i--) {
      if (tot + i * curr[cidx].first + 1 <= nos[idx]) {
        if (i == 1 && curr[cidx].first + 1 == nos[idx]) continue;
        m[curr[cidx].first] -= i;
        if (dfs2(idx, tot + i * curr[cidx].first, cidx + 1, curr, m))
          return true;
        m[curr[cidx].first] += i;
      }
    }
  }
  return false;
}
int main() {
  cin >> N;
  for (int i = 0; i < N; i++) cin >> nos[i];
  sort(nos, nos + N);
  map<int, int> m;
  int idx = 0;
  while (idx < N && nos[idx] == 1) {
    m[1] += 1;
    idx += 1;
  }
  if (dfs(idx, m))
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
