#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int sum = 0;
  bool flag = false;
  set<int> st;
  for (int i = 0; i < s.size(); i++) sum += (s[i] - '0');
  st.insert(0);
  for (int i = 1; i <= sqrt(sum); i++) {
    if (sum % i == 0) {
      st.insert(i);
      st.insert(sum / i);
    }
  }
  set<int>::iterator it = st.begin();
  for (int j = 0; j < st.size(); j++) {
    int number = *it;
    if (number > n || number == 1) {
      it++;
      continue;
    }
    int addition = 0, target = 0, i = 0;
    if (number != 0) target = sum / number;
    while (addition <= target && i < s.size()) {
      addition += (s[i] - '0');
      if (addition == target) addition = 0;
      i++;
    }
    if (i == n && addition == 0 || addition == target) {
      flag = true;
      break;
    }
    it++;
  }
  if (flag)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
