#include <iostream>
#include <set>
#include <algorithm>
using namespace std;

typedef long long ll;

int n;
int lim[52], vol[52];
set<ll> no[52];

bool solve(int idx);

bool distribute(int idx, int next){
  if(idx == n){
    return false;
  }

  ll bit = 0;

  for(int i = idx + 1; i < n; i++){
    bit <<= 1;
    if(vol[i] > 0){
      bit++;
    }
  }

  if(no[idx].find(bit) != no[idx].end()){
    return false;
  }
  no[idx].insert(bit);

  for(int i = next; i < n; i++){
    if(vol[i] != 0) continue;
    if(vol[idx] < lim[i]) continue;
    vol[idx] -= lim[i];
    vol[i] = lim[i];

    if(vol[idx] != 0 && distribute(idx, i + 1)) return true;
    if(vol[idx] == 0 && solve(idx + 1)) return true;

    vol[idx] += lim[i];
    vol[i] = 0;
  }

  return false;
}

bool solve(int idx){
  if(idx == n) return true;
  if(vol[idx] == 0) return false;

  if(solve(idx + 1)) return true;
  if(distribute(idx, idx + 1)) return true;

  return false;
}

int main(){
  while(cin >> n, n){
    for(int i = 0; i < n; i++){
      cin >> lim[i];
      no[i].clear();
      vol[i] = 0;
    }
    sort(lim, lim + n, greater<int>());

    vol[0] = lim[0];
    cout << (solve(0) ? "YES" : "NO") << endl;
  }
}