#include <bits/stdc++.h>
using namespace std;
int a[1000010];
int n;
inline int read() {
  register int x = 0, f = 1;
  register char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
  return x * f;
}
int main() {
  n = read();
  string temp;
  cin >> temp;
  int pos = 1, l = temp.length(), tot = 0;
  bool mark = 0;
  for (register int i = 1; i <= l; i++) a[i] = temp[i - 1] - '0';
  for (register int i = 1; i <= l; i++) tot += a[i];
  for (register int i = 2; i <= l; i++) {
    register int av = tot / i, t = 0, c = 0;
    if (av * i != tot) continue;
    for (register int j = 1; j <= l; j++) {
      t += a[j];
      if (t == av) c++, t = 0;
      if (t > av) break;
    }
    if (c == i) {
      mark = 1;
      puts("YES");
      break;
    }
  }
  if (mark == 0) puts("NO");
  return 0;
}
