#include <bits/stdc++.h>
using namespace std;
int n, sum = 0;
string s;
vector<int> v;
int main() {
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    int a = s[i] - '0';
    sum += a;
  }
  if (sum == 0) {
    cout << "YES";
    return 0;
  }
  if (sum > 1) {
    v.push_back(1);
  }
  for (int i = 2; i * i <= sum; i++) {
    if (sum % i == 0) {
      v.push_back(i);
      v.push_back(sum / i);
    }
  }
  for (int i = 0; i < v.size(); i++) {
    int temp = 0, chck = 1, tempsum = sum;
    for (int j = 0; j < n; j++) {
      temp += s[j] - '0';
      if (temp > v[i]) {
        chck = 0;
        break;
      }
      if (temp == v[i]) {
        tempsum -= temp;
        temp = 0;
      }
    }
    if (tempsum != 0) chck = 0;
    if (chck) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
}
