#include <bits/stdc++.h>
using namespace std;
int n, a[200], s[200];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  int q = 0;
  for (int i = 0; i < n; i++) {
    char c;
    cin >> c;
    if (c != '0') q = i + 1;
    a[i + 1] = c - '0';
    s[i + 1] = s[i] + a[i + 1];
  }
  n = q;
  if (n == 0) return cout << "YES" << endl, 0;
  for (int k = 0; k <= 900; k++) {
    int t = 0, x = 0;
    bool f = 1;
    for (int i = 1; i <= n; i++)
      if (s[i] - s[t] == k) {
        x++;
        t = i;
      } else if (s[i] - s[t] > k || i == n) {
        f = 0;
        break;
      }
    if (f && x > 1) return cout << "YES" << endl, 0;
  }
  cout << "NO" << endl;
  return 0;
}
