#include <bits/stdc++.h>
using namespace std;
int d[200];
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  d[0] = s[0] - '0';
  for (int i = 1; i < n; i++) d[i] = d[i - 1] + s[i] - '0';
  for (int i = 0; i < n - 1; i++) {
    int k = 0, f = 0;
    bool b = 0;
    for (int j = 0; j < n; j++) {
      k += s[j] - '0';
      if (k > d[i]) {
        b = 1;
        break;
      } else if (k == d[i])
        k = 0, f++;
    }
    if (!b && f > 1 && (k == d[i] || !k)) return cout << "YES", 0;
  }
  cout << "NO";
  return 0;
}
