#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int arr[n];
  int sum = 0;
  for (int i = 0; i < n; i++) {
    arr[i] = (s[i] - 48);
    sum += arr[i];
  }
  if (sum == 0) {
    cout << "YES";
    return 0;
  }
  bool aoa = false;
  for (int i = 2; i <= n; i++) {
    if (!(sum % i)) {
      int sum1 = sum / i;
      int nop = 0;
      int sums = 0;
      for (int j = 0; j < n; j++) {
        if (sums + arr[j] <= sum1) {
          sums += arr[j];
        } else {
          if (sums < sum1) {
            break;
          }
          sums = arr[j];
          nop++;
        }
      }
      if (sums > 0)
        if (sums == sum1)
          if (nop == i - 1) {
            aoa = true;
          }
    }
  }
  if (aoa)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
