#include <bits/stdc++.h>
using namespace std;
int a[11111] = {0}, b[11111] = {0};
char s[1100];
int main() {
  int n, ans = 0, j, i, sum;
  cin >> n;
  getchar();
  for (i = 1; i <= n; i++) {
    scanf("%c", &s[i]);
  }
  for (i = 1; i <= n; i++) {
    a[i] = s[i] - '0';
    b[i] = b[i - 1] + a[i];
  }
  int t = 0;
  for (i = 1; i < n; i++) {
    ans = 0;
    sum = 1;
    for (j = i + 1; j <= n; j++) {
      ans += a[j];
      if (ans == b[i]) {
        ans = 0;
        sum++;
      }
      if (ans > b[i]) break;
      if (j == n && ans == 0 && sum != 1) t = 1;
    }
    if (t == 1) break;
  }
  if (t == 1)
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
