#include <bits/stdc++.h>
using namespace std;
template <typename T = long long>
inline T read() {
  T s = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    s = (s << 3) + (s << 1) + ch - 48;
    ch = getchar();
  }
  return s * f;
}
const int N = 1e5 + 5, M = 1e6 + 5, MOD = 1e9 + 7, CM = 998244353,
          INF = 0x3f3f3f3f;
char s[N], pre[N];
void solve(int kase) {
  int n = read();
  scanf("%s", s + 1);
  int sum = 0;
  set<char> ss;
  for (int i = 1; i <= n; i++) sum += s[i] - '0', ss.insert(s[i]);
  if (ss.size() == 1) {
    printf("YES\n");
    return;
  }
  for (int i = 1; i < sum; i++) {
    if (sum % i == 0) {
      int last = INF, nowsum = 0;
      int j;
      for (j = 1; j <= n; j++) {
        nowsum += s[j] - '0';
        if (nowsum == i) {
          if (last < nowsum) break;
          last = nowsum;
          nowsum = 0;
        }
        if (nowsum > i) break;
      }
      if (j == n + 1 && nowsum == 0) {
        printf("YES\n");
        return;
      }
    }
  }
  printf("NO\n");
}
const bool DUO = 0;
int main() {
  clock_t start, finish;
  double totaltime;
  start = clock();
  if (DUO) {
    int Kase = 0;
    cin >> Kase;
    for (int kase = 1; kase <= Kase; kase++) solve(kase);
  } else
    solve(1);
  finish = clock();
  return 0;
  printf("\nTime: %lfms\n", (double)(finish - start) / CLOCKS_PER_SEC * 1000);
  return 0;
}
