#include <bits/stdc++.h>
using namespace std;
vector<int> a;
char c;
int n, k = 0;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> c;
    if (c - '0')
      a.push_back(c - '0');
    else
      k++;
  }
  if (k == n) {
    cout << "YES";
    return 0;
  }
  int t = 0, f = 0;
  for (int i = 0; i <= 900; i++) {
    t = 0, f = 0;
    for (int j = 0; j < a.size(); j++) {
      t += a[j];
      if (j == a.size() - 1 && t == i && f == 1) {
        cout << "YES";
        return 0;
      }
      if (t == i) {
        f = 1;
        t = 0;
      } else if (t > i) {
        t = 0;
        f = 0;
        break;
      }
    }
  }
  cout << "NO";
  return 0;
}
