#include <bits/stdc++.h>
using namespace std;
int oo = (1e9) + 7;
long long oo2 = 1ll * oo * oo;
int n;
string s;
int main() {
  cin >> n >> s;
  int sum = 0;
  for (int i = 0; i < n - 1; ++i) {
    sum += s[i] - '0';
    bool ok = true;
    int pos = i + 1;
    int sum2 = 0;
    while (pos < n) {
      sum2 = s[pos++] - '0';
      while (pos < n and sum2 + s[pos] - '0' <= sum) {
        sum2 += s[pos] - '0';
        ++pos;
      }
      if (sum2 != sum) ok = false;
    }
    if (sum2 != sum) ok = false;
    if (ok) return printf("YES"), 0;
  }
  puts("NO");
  return 0;
}
