#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, k;
  string s;
  cin >> n >> s;
  while (s.find('0') != std::string::npos) s.erase(s.find('0'), 1);
  n = s.size();
  if (n == 0) {
    cout << "YES";
    return 0;
  }
  vector<int> b(n + 1);
  b[0] = 0;
  for (i = 0; i < n; i++) b[i + 1] = b[i] + (s[i] - '0');
  for (i = 1; i < n; i++) {
    k = i;
    for (j = i + 1; j <= n; j++) {
      if (b[j] - b[k] > b[i]) break;
      if (b[j] - b[k] == b[i]) k = j;
    }
    if (k == n) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
