#include <bits/stdc++.h>
using namespace std;
bool divide(int arr[], int k, int lastIndex, int sum) {
  if (lastIndex < 0 && k != 0) {
    return false;
  } else if (k == 0) {
    return true;
  }
  int sum1 = 0;
  for (int i = lastIndex; i >= 0; i--) {
    sum1 += arr[i];
    if (sum1 == sum) {
      return divide(arr, k - 1, i - 1, sum);
    } else if (sum1 > sum) {
      return false;
    }
  }
}
int main() {
  int n;
  cin >> n;
  int sum = 0;
  int a[n];
  int max = -1;
  for (int i = 0; i < n; i++) {
    char c;
    cin >> c;
    a[i] = c - '0';
    int k = a[i];
    sum += k;
    if (k > max) max = k;
  }
  for (int k = 2; k <= n; k++) {
    if (sum % k == 0 && max <= sum / k && divide(a, k, n - 1, sum / k)) {
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
  return 0;
}
