#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string str;
  cin >> n;
  cin >> str;
  vector<int> v(n + 1);
  v[1] = str[0] - '0';
  int k = 0;
  if (v[1] == 0) {
    v[0] = 0;
    k++;
  }
  for (int i = 2; i <= n; i++) {
    if (str[i - 1] == '0') {
      k++;
      continue;
    }
    v[i - k] = v[i - 1 - k] + str[i - 1] - '0';
  }
  if (k == n) {
    cout << "YES\n";
    return 0;
  }
  int sum, j;
  int k1;
  for (int i = 1; i <= n - k; i++) {
    j = i + 1;
    k1 = i;
    while (j <= (n - k)) {
      if ((v[j] - v[k1]) == v[i]) {
        if (j == n - k) {
          cout << "YES\n";
          return 0;
        } else {
          k1 = j;
        }
      } else if ((v[j] - v[k1]) > v[i])
        break;
      j++;
    }
  }
  cout << "NO\n";
  return 0;
}
