#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int num[200];
  int ansp[200];
  string t;
  int now = 0;
  cin >> n >> t;
  int isok = 0;
  int count = 0;
  for (int i = 1; i <= n; i++) {
    int tt = int(t[i - 1] - '0');
    if (tt == 0) {
      continue;
    }
    count++;
    num[count] = tt;
    now += num[count];
    ansp[count] = now;
  }
  if (now == 0 && n >= 2) {
    cout << "YES" << endl;
    return 0;
  }
  if (count < 2) {
    cout << "NO" << endl;
    return 0;
  }
  n = count;
  int ex = 0;
  for (int i = 1; i <= (n - 1); i++) {
    ex += num[i];
    int temp = 0;
    for (int j = i + 1; j <= n; j++) {
      temp += num[j];
      if (temp == ex) {
        temp -= ex;
      } else if (temp > ex) {
        break;
      }
      if (j == n && temp == 0 && !isok) {
        isok = 1;
      }
    }
  }
  if (isok) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
