#include <bits/stdc++.h>
using namespace std;
signed main() {
  int n;
  cin >> n;
  string a;
  cin >> a;
  for (int i = 0, s = 0; i + 1 < n; i++) {
    s += a[i] - '0';
    int q = 0, z = 0, c = 0;
    for (int j = i + 1; j < n; j++) {
      q += a[j] - '0';
      if (q > s) z = 1;
      if (q == s) {
        q = 0;
        c++;
      }
    }
    if (!z && c && !q) return cout << "YES", 0;
  }
  cout << "NO\n";
  return 0;
}
