#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n, sum = 0, j, temp, ans = 0;
  string num;
  cin >> n >> num;
  for (i = 0; i < n; i++) sum += num[i] - '0';
  for (i = 2; i <= n; i++) {
    j = 0;
    if (sum % i == 0) {
      while (j < n) {
        temp = 0;
        while (temp < (sum / i) && j < n) {
          temp += num[j] - '0';
          j++;
        }
        if (sum == 0) j++;
        if (temp > (sum / i))
          break;
        else if (j == n)
          ans = 1;
      }
    }
  }
  if (ans)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
