
import std.stdio, std.algorithm, std.typecons;

enum Type {Empty = 0, Fill, Used}

alias Tuple!(int, "cap", Type, "type") Cup;

void show_state(Cup[] state, int n) {  
  writeln("index:", n);
  foreach(i, s; state) {
    writefln("[%d] cap: %d, type: %s", i, s.cap, s.type);
  }
  writeln;
}

// index 番目以降のコップに cap だけ注ぐ
int[] pour(Cup[] state, int cap, int index) {
  int[] inner(Cup[] state, int cap, int index, int[] rest) {
    if (cap == 0) return rest;
    if (cap < 0) return [];
    for(int i = index; i < state.length; i++) {
      if (state[i].type == Type.Empty) {
        state[i].type = Type.Fill;
        int[] res = inner(state, cap - state[i].cap, i + 1, rest ~ [i]);
        if (res != []) return res;
        state[i].type = Type.Empty;
      }
    }
    return [];
  }
  return inner(state, cap, index, []);
}

bool exists_empty(Cup[] state) {
  bool res = false;
  foreach(s; state) res |= (s.type == Type.Empty);
  return res;
}

bool rec(Cup[] state, int index) {
  if (!exists_empty(state)) return true;
  
  for(int i = index; i < state.length; i++) {
    if (state[i].type == Type.Fill) {
      state[i].type = Type.Used;
      int[] res = pour(state.dup, state[i].cap, i);
      if (!(res == [])) {
        foreach(r; res) {
          state[r].type = Type.Fill;
        }
        if (rec(state, i + 1)) return true;
        foreach(r; res) {
          state[r].type = Type.Empty;
        }
      }
      state[i].type = Type.Fill;
    }
    else if (state[i].type == Type.Empty) return false;
  }
  return false;
}

bool solve(int[] arr) {
  Cup[] state;
  foreach(i; arr) state ~= Cup(i, Type.Empty);
  state[0].type = Type.Fill;
  return rec(state, 0);
}

void main() {
  for(int times; readf("%d\n", &times), times != 0;) {
    int[] arr = new int[](times);
    foreach(i; 0..times)
      scanf((i == times - 1) ? "%d\n" : "%d", &arr[i]);
    sort!q{a > b}(arr);
    writeln(solve(arr) ? "YES" : "NO");
  }
}