#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long res = 0, pd = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') pd = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    res = (res << 3) + (res << 1) + c - '0';
    c = getchar();
  }
  return res * pd;
}
inline void write(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) write(x / 10);
  putchar(x % 10 | '0');
}
inline void wlk(long long x) {
  write(x);
  putchar(32);
}
inline void wln(long long x) {
  write(x);
  putchar(10);
}
const long long maxn = 103;
long long a[maxn], sum[maxn];
signed main() {
  long long n = read();
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  a[1] = c - '0';
  for (long long i = 2; i <= n; ++i) {
    a[i] = getchar() - '0';
    if (!a[i]) i--, n--;
  }
  if (!n) return puts("YES"), 0;
  for (long long i = 1; i <= n; ++i) sum[i] = sum[i - 1] + a[i];
  long long T = sum[n] / 2 + 1;
  while (T--) {
    long long l = 1, r = 1;
    while (r <= n) {
      if (sum[r] - sum[l - 1] == T) l = r + 1, r = r;
      if (sum[r] - sum[l - 1] > T) goto loop;
      r++;
    }
    if (l <= n && sum[n] - sum[l - 1] != T) goto loop;
    return puts("YES"), 0;
  loop:;
  }
  return puts("NO"), 0;
}
