#include <bits/stdc++.h>
const double eps = 1e-8;
const double pi = acos(-1.0);
const int inf = 0x3f3f3f3f;
const long long int INF = 1e18 + 100;
const int maxm = 1e6 + 6;
const int maxn = 100 + 10;
const int mod = 10000;
using namespace std;
template <typename T>
void re(T &x) {
  x = 0;
  int f = 0;
  char ch = getchar();
  while (!((ch) >= '0' && (ch) <= '9')) {
    if (ch == '-') f = 1;
    ch = getchar();
  }
  while (((ch) >= '0' && (ch) <= '9')) {
    x = (x << 3) + (x << 1) + ch - '0';
    ch = getchar();
  }
  x = f ? -x : x;
}
template <typename T>
T fpow(T a, T b) {
  T ans = 1;
  while (b) {
    if (b & 1) ans = a * ans % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return ans;
}
int b[maxn];
char str[105];
int main() {
  int n, k = 0, sum = 0;
  scanf("%d%s", &n, str);
  for (int i = 0; i < n; ++i) {
    sum += str[i] - '0';
  }
  for (int i = 2; i <= n; ++i)
    if (sum % i == 0) b[k++] = sum / i;
  int flag = 0;
  for (int i = 0; i < k; ++i) {
    int ans = 0;
    for (int j = 0; j < n; ++j) {
      ans += str[j] - '0';
      if (ans == b[i])
        ans = 0;
      else if (ans > b[i])
        break;
    }
    if (ans == 0) {
      flag = 1;
      break;
    }
  }
  if (flag)
    puts("YES");
  else
    puts("NO");
  return 0;
}
