#include <bits/stdc++.h>
using namespace std;
template <class Type>
Type max_in_array(vector<Type> arr) {
  Type m = arr[0];
  for (auto i : arr)
    if (i > m) m = i;
  return m;
}
template <class Type>
Type min_in_array(vector<Type> arr) {
  Type m = arr[0];
  for (auto i : arr)
    if (i < m) m = i;
  return m;
}
template <class Type>
long long sum_of_array(vector<Type> arr) {
  long long m = 0;
  for (auto i : arr) m += i;
  return m;
}
template <class Type>
Type binpow(Type value, int pow) {
  Type res = 1;
  while (pow) {
    if (pow & 1) res *= value;
    value *= value;
    pow >>= 1;
  }
  return res;
}
long long gcd(long long a, long long b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
template <class Type>
struct Sqrt_deque {
  deque<Type> deq;
  Type max_elem;
  long long ind_max;
  Type min_elem;
  long long ind_min;
};
template <class Type>
deque<Sqrt_deque<Type>> deque_to_sqrt(
    deque<Type> deq, long long max_size,
    const function<bool(Type* el1, Type* el2)> larger1then2 =
        [](long long* el1, long long* el2) { return *el1 > *el2; }) {
  deque<Sqrt_deque<Type>> sqrt_deq;
  long long s_size = min((long long)round(sqrt(deq.size())), max_size);
  while (!deq.empty()) {
    Sqrt_deque<Type> s_deq;
    Type elem = deq.front();
    s_deq.max_elem = elem;
    s_deq.ind_max = 0;
    s_deq.min_elem = elem;
    s_deq.ind_min = 0;
    s_deq.deq.push_back(elem);
    deq.pop_front();
    if (deq.size() <= s_size - 1) {
      long long ind = 1;
      while (!deq.empty()) {
        Type elem = deq.front();
        if (larger1then2(&elem, &s_deq.max_elem)) {
          s_deq.max_elem = elem;
          s_deq.ind_max = ind;
        }
        if (larger1then2(&s_deq.min_elem, &elem)) {
          s_deq.min_elem = elem;
          s_deq.ind_min = ind;
        }
        s_deq.deq.push_back(elem);
        deq.pop_front();
        ind++;
      }
    } else {
      for (long long i = 1; i < s_size; i += 1) {
        Type elem = deq.front();
        if (larger1then2(&elem, &s_deq.max_elem)) {
          s_deq.max_elem = elem;
          s_deq.ind_max = i;
        }
        if (larger1then2(&s_deq.min_elem, &elem)) {
          s_deq.min_elem = elem;
          s_deq.ind_min = i;
        }
        s_deq.deq.push_back(elem);
        deq.pop_front();
      }
    }
    sqrt_deq.push_back(s_deq);
  }
  return sqrt_deq;
}
int main() {
  int n;
  cin >> n;
  string st;
  cin >> st;
  vector<int> a;
  for (auto i : st) a.push_back((int)i - 48);
  for (long long i = 1; i < n; i += 1) {
    int s = 0;
    for (long long j = 0; j < i; j += 1) s += a[j];
    int ps = 0;
    bool was = false;
    for (long long j = i; j < n; j += 1) {
      ps += a[j];
      if (ps == s) {
        ps = 0;
        was = true;
      }
    }
    if (ps == 0 && was) {
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
  return 0;
}
