#include <bits/stdc++.h>
using namespace std;
char c;
int n, total, dig[105];
int main() {
  cin >> n;
  for (int ana = 0; ana < n; ana++) {
    cin >> c;
    dig[ana] = c - '0';
    total += dig[ana];
  }
  for (int ani = 2; ani <= n; ani++) {
    if (total % ani == 0) {
      int idx = 0;
      int kam = 0;
      for (int anu = 0; anu < n; anu++) {
        kam += dig[anu];
        if (kam == total / ani) {
          idx++;
          kam = 0;
        }
      }
      if (idx == ani) {
        cout << "YES\n";
        return 0;
      }
    }
  }
  cout << "NO\n";
  return 0;
}
