#include <bits/stdc++.h>
using namespace std;
char str1[105];
int z[105], sum[105] = {0};
int main() {
  int n;
  while (cin >> n) {
    int sum1 = 0;
    for (int i = 1; i <= n; i++) {
      cin >> str1[i];
      sum1 = sum1 + (str1[i] - '0');
      sum[i] = sum1;
    }
    int d = 0;
    for (int i = n; i >= 1; i--) {
      if (sum1 % i == 0) {
        z[d] = sum1 / i;
        d++;
      }
    }
    int flag = 0;
    for (int i = 1; i <= n; i++) {
      int p = 0;
      for (int j = 0; j < d; j++) {
        if (sum[i] == z[j]) {
          int g = 0;
          for (int k = i; k <= n; k++) {
            if (sum[k] - sum[g] == sum[i]) {
              p++;
              g = k;
            }
            if (sum[k] - sum[g] > sum[i]) {
              p = -99999999;
            }
          }
        }
      }
      if (p >= 2) {
        flag = 1;
        break;
      }
    }
    if (flag == 1) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
}
