#include <bits/stdc++.h>
using namespace std;
long long n, m;
string s;
bool kt(long long as) {
  long long q = 0;
  for (int i = 0; i <= n - 1; ++i) {
    q += s[i] - 48;
    if (q == as) q = 0;
  }
  if (q == 0)
    return true;
  else
    return false;
}
int main() {
  cin >> n;
  cin >> s;
  for (int i = 0; i <= n - 1; ++i) {
    long long z = s[i] - 48;
    m += z;
  }
  long long l = 1, r = 2 * n;
  for (int mid = 2; mid <= 2 * n; ++mid) {
    {
      if (kt(m / mid) == true) {
        cout << "YES";
        return 0;
      }
    }
  }
  cout << "NO" << endl;
  return 0;
}
