#include <bits/stdc++.h>
#pragma warning(disable : 4996)
int n;
char s[110];
int sum[110];
int solve(int num) {
  int ans = 0;
  int k = sum[n - 1] / num;
  for (int i = 0; i < n; i++) {
    if (s[i] != '0' && sum[i] % k == 0) ans++;
  }
  if (ans >= num)
    return 1;
  else
    return 0;
}
int main() {
  int real_num = 0;
  scanf("%d", &n);
  scanf("%s", s);
  int x = s[0] - '0';
  sum[0] = x;
  if (x != 0) real_num++;
  for (int i = 1; i < n; i++) {
    x = s[i] - '0';
    if (x != 0) real_num++;
    sum[i] = sum[i - 1] + x;
  }
  int flag = 0;
  if (real_num == 0) flag = 1;
  if (!flag) {
    for (int i = 2; i <= n; i++) {
      if (sum[n - 1] % i == 0) {
        int ans = solve(i);
        if (ans) {
          flag = 1;
          break;
        }
      }
    }
  }
  if (flag) {
    printf("YES\n");
  } else {
    printf("NO\n");
  }
  return 0;
}
