#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
using namespace std;
#define rep(i,n) for(int i = 0 ; i < n ; i++)
bool used[51];
int cap[51];
int n;

bool dp[51][101][51] = {0};
int pv[51][101][51] = {0};

bool bt(int pos){
	//cout <<pos << endl;rep(i,n)cout << used[i];cout << endl;
	if(pos == n) return count(used,used+n,true) == n;
	if(!used[pos]) return false;
	
	memset(dp,0,sizeof(dp));
	dp[0][0][0] = true;
	int i = 0 , rename = 0 , re[51];
	for(int k = 0 ; k < n ; k++){
		if(used[k]) continue;
		re[rename++] = k;
	}
	//2 2 1
	for(int I = 0 ; I < n ; I++){
		if(used[I]){ continue; };
		for(int k = 0 ; k <= i ; k++){
			for(int j = 0 ; j <= cap[pos] ; j++){
				if(j + cap[I] <= cap[pos] && dp[i][j][k] && !dp[i+1][j+cap[I]][k+1]){
					dp[i+1][j+cap[I]][k+1] = true;
					pv[i+1][j+cap[I]][k+1] = j;
				}
				if(dp[i][j][k] && !dp[i+1][j][k]){
					dp[i+1][j][k] = true;
					pv[i+1][j][k] = j;
				}
			}
		}
		i++;
	}
	vector< vector<int> > cad;
	for(int k = i ; k >= 1 ; k--){
		if(!dp[i][cap[pos]][k])continue;
		vector<int> v;
		int p = i , q = k , u = cap[pos];
		while(q != 0){
			int r = pv[p][u][q];
			if(r != u){
				v.push_back(cap[re[p-1]]);
				q--;
			}
			p--;
			u = r;
		}
		cad.push_back(v);
	}
	for(int k = 0 ; k < cad.size() ; k++){
		//cout << cap[pos] << "]" << cad[k].size() << ":"; rep(j,cad[k].size()) cout << cad[k][cad[k].size()-j-1] << " ";cout << endl;
		
		int w = 0 , ww[50]={0};
		for(int j = cad[k].size()-1 ; j >= 0 ; j--){
			while(used[w] || cap[w] != cad[k][j])w++;
			used[w] = true , ww[j] = w; 
		}
		//rep(j,cad[k].size()) cout << ww[j] << "<";cout << endl;
		if( bt(pos+1) ) return true;
		for(int j = 0 ; j < cad[k].size() ; j++){
			used[ww[j]] = false;
		}
	}
	return bt(pos+1);
}
int main(){
	while(cin >> n &&n){
		rep(i,n)cin >> cap[i];
		sort(cap,cap+n,greater<int>());
		memset(used,0,sizeof(used));
		used[0] = true;
		cout << (bt(0)?"YES":"NO")  << endl;
	}
}