#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i, sum = 0, count;
  char c;
  cin >> n;
  vector<int> Arr(n);
  for (i = 0; i < n; i++) {
    cin >> c;
    Arr[i] = c - '0';
    sum += int(c - '0');
  }
  bool tf = 0;
  for (i = 2; i <= n; i++) {
    if (sum % i == 0) {
      bool flag = 0;
      int now = 0;
      for (int k = 0; k < i; k++) {
        count = sum / i;
        while (now < n && count >= Arr[now]) {
          count -= Arr[now];
          now++;
        }
        if (count != 0) {
          flag = 1;
          break;
        }
      }
      if (!flag) {
        tf = 1;
        break;
      }
    }
  }
  if (tf)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
