#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int n;
int a[N], sum[N];
char str[N];
int main() {
  scanf("%d", &n);
  scanf("%s", str + 1);
  if (n == 1) {
    puts("NO");
    return 0;
  }
  for (register int i = 1; i <= n; ++i) a[i] = str[i] - '0';
  int cnt = 0;
  for (register int i = 1; i <= n; ++i)
    if (a[i]) a[++cnt] = a[i];
  n = cnt;
  if (!n) {
    puts("YES");
    return 0;
  }
  for (register int i = 1; i <= n; ++i) sum[i] = sum[i - 1] + a[i];
  for (register int i = 1; i < n; ++i) {
    int j = i + 1;
    bool jay = true;
    while (j <= n) {
      int now = 0;
      int k = j;
      while (k <= n && now < sum[i]) {
        now += a[k];
        if (now >= sum[i]) break;
        k++;
      }
      if (now != sum[i]) {
        jay = false;
        break;
      }
      j = k + 1;
    }
    if (jay) {
      puts("YES");
      return 0;
    }
  }
  puts("NO");
  return 0;
}
