#include <bits/stdc++.h>
using namespace std;
int n;
int sum[100 + 5];
string s;
int main() {
  cin >> n;
  cin >> s;
  sum[0] = s[0] - '0';
  for (int i = 1; i < n; i++) sum[i] = sum[i - 1] + (s[i] - '0');
  if (sum[n - 1] == 0) {
    if (find(sum, sum + n, 0) - sum < n) {
      cout << "YES";
      return 0;
    }
  }
  for (int i = 2; i <= sum[n - 1]; i++) {
    int u1 = sum[n - 1] % i, u2 = sum[n - 1] / i;
    if (u1 == 0) {
      int mcount = 0, u = 0;
      while (true) {
        u += u2;
        if (find(sum, sum + n, u) - sum < n)
          mcount++;
        else
          break;
      }
      if (mcount == i) {
        cout << "YES";
        return 0;
      }
    }
  }
  cout << "NO";
  return 0;
}
