#include<iostream>
#include<vector>
#include<map>
#include<algorithm>
#include<functional>
using namespace std;

map<pair<vector<int>, vector<int>>, bool> memo;

vector<vector<int>> select(int water, const vector<int>& empty, int n) {
    vector<vector<int>> result;
    for(int i = n; i < empty.size(); ++i) {
        int _water = water - empty[i];
        if(_water < 0) continue;
        else if(_water == 0) result.push_back({i});
        else {
            for(const vector<int>& list: select(_water, empty, i + 1)) {
                vector<int> add = {i};
                add.insert(add.end(), list.begin(), list.end());
                result.push_back(add);
            }
        }
    }
    return result;
}

bool check(const vector<int>& full, const vector<int>& empty) {
    if(memo.count(make_pair(full, empty))) return memo[make_pair(full, empty)];
    if(empty.empty()) return memo[make_pair(full, empty)] = true;
    for(int i = 0; i < full.size(); ++i) {
        int water = full[i];
        if(water < empty.front()) break;

        for(const auto& list: select(water, empty, 0)) {
            if(list.front() != 0) break;
            vector<int> _full = full;
            _full.erase(_full.begin() + i);
            vector<int> _empty = empty;

            int deleted = 0;
            for(const auto& i: list) {
                _full.push_back(_empty[i - deleted]);
                _empty.erase(_empty.begin() + i - deleted);
                ++deleted;
            }

            sort(_full.begin(), _full.end(), greater<int>());
            if(check(_full, _empty)) return memo[make_pair(full, empty)] = true;
        }
    }
    return memo[make_pair(full, empty)] = false;
}

int main() {
    int n;
    while(cin >> n, n) {
        vector<int> empty(n);
        for(auto& e: empty) cin >> e;
        sort(empty.begin(), empty.end(), greater<int>());
        vector<int> full = {empty.front()};
        empty.erase(empty.begin());
        memo.clear();
        cout << (check(full, empty) ? "YES" : "NO") << endl;
    }
}