#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
long long gcd(long long a, long long b) {
  if (!b) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
long long ExtendedEuclidean(long long a, long long b, long long& x,
                            long long& y) {
  if (!b) {
    x = 1, y = 0;
    return a;
  }
  long long x1, y1;
  long long subProb = ExtendedEuclidean(b, a % b, x1, y1);
  x = y1, y = x1 - (a / b) * y1;
  return subProb;
}
long long fpow(long long a, long long b) {
  if (!b) return 1;
  long long t = fpow(a, b / 2);
  if (b & 1) return t * t % mod * a % mod;
  return t * t % mod;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  ;
  int t = 1;
  while (t--) {
    long long n;
    cin >> n;
    string s;
    cin >> s;
    int sum = 0;
    bool f;
    for (int i = 0; i < n - 1; i++) {
      sum += (s[i] - '0');
      int j = i + 1, cur = 0;
      f = 1;
      while (j < n) {
        cur = 0;
        int k = j;
        while (j < n && cur + s[j] - '0' <= sum) {
          cur += s[j] - '0';
          j++;
        }
        if (j >= n) {
          if (cur != sum) {
            f = 0;
          } else
            f = 1;
          break;
        }
        if (k == j || cur != sum) {
          f = 0;
          break;
        }
      }
      if (f) break;
    }
    if (f)
      cout << "YES";
    else
      cout << "NO";
    cout << "\n";
  }
  return 0;
}
