#include <bits/stdc++.h>
using namespace std;
bool di(const vector<int>& digs, const int& sum, int a, int nums) {
  if (nums == 1) {
    return false;
  }
  int su = 0;
  int wsum = 0;
  int i = 0;
  while (nums > 0 && i < digs.size()) {
    if (su == a) {
      su = 0;
      nums--;
    } else if (su > a) {
      return false;
    }
    su += digs[i];
    wsum += digs[i];
    i++;
  }
  return ((wsum == sum && (nums == 1 || nums == 0)) ? true : false);
}
bool check(const vector<int>& g, int n) {
  while (n-- >= 0 && g[n] == g[0])
    ;
  return n == -1;
}
int main() {
  int n;
  int su = 0;
  cin >> n;
  vector<int> digs(n);
  for (int i = 0; i < n; i++) {
    scanf("%1d", &digs[i]);
    su += digs[i];
  }
  if (check(digs, digs.size())) {
    cout << "YES" << endl;
    return 0;
  }
  int sqrtsu = sqrt(su);
  int ln = digs.size();
  bool w = false;
  for (int i = 1; i <= sqrtsu; ++i) {
    if (su % i == 0) {
      if (di(digs, su, i, su / i) || (di(digs, su, su / i, i) && i != 1)) {
        cout << "YES" << endl;
        w = true;
        break;
      }
    }
  }
  if (!w) {
    cout << "NO" << endl;
  }
}
