#include <bits/stdc++.h>
using namespace std;
const int modulo = 1e9 + 7;
template <class __Ty>
bool mini(__Ty& a, __Ty b) {
  return a > b ? ((a = b) | 1) : (0);
}
template <class __Ty>
bool maxi(__Ty& a, __Ty b) {
  return a < b ? ((a = b) | 1) : (0);
}
template <class __Ty>
__Ty add(__Ty a, __Ty b) {
  return (a + b) % (__Ty(modulo));
}
template <class __Ty>
__Ty sub(__Ty a, __Ty b) {
  __Ty m(modulo);
  return ((a - b) % m + m) % m;
}
const int N = 1e2 + 5;
char a[N];
int n;
bool check(int s) {
  int cnt = 0, i = 1;
  while (i <= n) {
    int sum = a[i] - '0';
    int j = i + 1;
    while (sum <= s && j <= n) sum += a[j++] - '0';
    if (sum > s && j > i + 1) {
      sum -= a[j - 1] - '0';
      --j;
    }
    if (sum != s) return false;
    i = j;
    cnt++;
  }
  0;
  return cnt >= 2;
}
bool check2(int s) {
  queue<int> q;
  for (int i = 1; i <= n; ++i) q.push(a[i] - '0');
  int cnt = 0;
  while (!q.empty()) {
    int sum = 0;
    while (!q.empty() && sum + q.front() <= s) {
      sum += q.front();
      q.pop();
    }
    if (sum != s) return 0;
    cnt++;
  }
  return cnt >= 2;
}
int main() {
  int sum = 0;
  scanf("%d%s", &n, a + 1);
  for (int i = 1; i <= n; ++i) sum += a[i] - '0';
  if (sum == 0) {
    cout << "YES";
    return 0;
  }
  for (int i = 1; i <= sum; ++i)
    if (sum % i == 0 && check(i)) {
      0;
      cout << "YES";
      return 0;
    }
  cout << "NO";
  return 0;
}
