#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int tsum = 0;
  for (int i = 0; i < n; ++i) tsum += s[i] - '0';
  for (int i = 1; i < n; ++i) {
    vector<int> sums;
    int sum = 0;
    for (int j = 0; j < i; ++j) sum += s[j] - '0';
    sums.push_back(sum);
    int prev = i;
    int j = i;
    while (j < n) {
      j = prev;
      int c = 0;
      while (c + (s[j] - '0') <= sum && j < n) {
        c += s[j] - '0';
        j++;
      }
      if (j == prev) j++;
      sums.push_back(c);
      prev = j;
    }
    int jsum = 0;
    for (int x = 0; x < sums.size(); ++x) jsum += sums[x];
    int flag = 0;
    for (int k = 0; k < sums.size() - 1; ++k) {
      if (sums[k] != sums[k + 1]) {
        flag = 1;
        break;
      }
    }
    if (flag == 0 && jsum == tsum) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
}
