#include <bits/stdc++.h>
using namespace std;
const int SIZE = 105;
int a[SIZE], sum = 0;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%1d", &a[i]);
    sum += a[i];
  }
  if (sum == 0) {
    puts("YES");
    return 0;
  }
  for (int i = 1; i < sum; i++) {
    if (sum % i) continue;
    int nums = 0, tot = 0;
    for (int j = 1; j <= n; j++) {
      nums += a[j];
      if (nums > i) break;
      if (nums == i) nums = 0, tot++;
    }
    if (nums == 0 && tot == sum / i) {
      puts("YES");
      return 0;
    }
  }
  puts("NO");
  return 0;
}
