#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, sum = 0, a[100], b[100];
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; i < n; ++i) {
    a[i] = int(s[i] - '0');
    sum += a[i];
  }
  if (sum == 0) {
    cout << "YES";
    return 0;
  }
  b[0] = a[0];
  for (int i = 1; i < n; ++i) b[i] = a[i] + b[i - 1];
  for (int i = 1; i < sum; ++i)
    if (sum % i == 0) {
      int o = 0, last = -1;
      for (int j = 0; j < n; ++j) {
        if (last == -1) {
          if (b[j] == i) {
            last = j;
            o++;
          }
        } else {
          if (b[j] - b[last] == i) {
            last = j;
            o++;
          }
        }
      }
      if (o == sum / i) {
        cout << "YES";
        return 0;
      }
    }
  cout << "NO";
}
