#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int i, j, n, sum = 0;
  string str;
  cin >> n;
  cin >> str;
  map<int, bool> mp;
  vector<int> vec(n, 0);
  for (i = 0; i < str.length(); ++i) {
    j = str[i] - 48;
    sum += j;
    vec[i] = sum;
    mp[sum] = 1;
  }
  if (sum == 0) {
    cout << "YES";
    return 0;
  }
  int y;
  for (i = 0; i < n - 1; ++i) {
    if (vec[i] != sum && vec[i] != 0 && (sum % vec[i]) == 0) {
      y = vec[i];
      while (y <= sum && mp[y] == 1) {
        y += vec[i];
      }
      if (y == (sum + vec[i])) {
        cout << "YES";
        return 0;
      }
    }
  }
  cout << "NO";
}
