#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long sum = 0;
  for (long long i = 0; i < n - 1; i++) {
    sum += s[i] - '0';
    bool ok = true;
    long long pos = i + 1;
    long long sum2 = 0;
    while (pos < n) {
      sum2 = s[pos++] - '0';
      while (pos < n && sum2 + s[pos] - '0' <= sum) {
        sum2 += s[pos] - '0';
        ++pos;
      }
      if (sum2 != sum) ok = false;
    }
    if (sum2 != sum) ok = false;
    if (ok) {
      puts("YES");
      return 0;
    }
  }
  cout << "NO" << endl;
  return 0;
}
