#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, flag = 0, sum = 0, cur = 0;
  string s;
  cin >> n >> s;
  map<int, int> mp;
  for (i = 0; i < n; i++) {
    j = s[i] - '0';
    sum += j;
    mp[sum] = 1;
  }
  for (i = 0; i < n; i++) {
    j = s[i] - '0';
    cur += j;
    int tmp = cur;
    int cnt = 0;
    while (tmp <= sum) {
      if (mp[tmp]) {
        cnt++;
        if (tmp == sum && cnt > 1) {
          flag = 1;
          break;
        }
        tmp += cur;
        if (j == 0) break;
      } else
        break;
    }
  }
  if (flag || sum == 0) {
    cout << "YES" << endl;
  } else
    cout << "NO" << endl;
  return 0;
}
