#include <bits/stdc++.h>
using namespace std;
bool check(string s, int n) {
  for (int i = 0; i < n; i++) {
    if (s[i] != '0') return false;
  }
  return true;
}
int maxx(string s, int n) {
  int maxx = -1;
  for (int i = 0; i < n; i++) {
    maxx = max(maxx, s[i] - 48);
  }
  return maxx;
}
int main() {
  long long n, sum = 0, ct = 0, res, i, k = 0;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    sum += s[i] - 48;
  }
  if (check(s, n))
    cout << "YES";
  else if (maxx(s, n) > sum / 2)
    cout << "NO";
  else {
    res = sum / maxx(s, n);
    while (res >= 2) {
      ct = 0;
      k = 0;
      if (sum % res == 0) {
        for (int i = 0; i < n; i++) {
          k += s[i] - 48;
          if (k == sum / res) {
            ct++;
            k = 0;
          }
        }
        if (k == 0 && ct > 1) {
          cout << "YES";
          return 0;
        }
      }
      res--;
    }
    cout << "NO";
  }
  return 0;
}
