#include <bits/stdc++.h>
using namespace std;
const int MAX = 3e5 + 5;
const int INF = 0x3f3f3f3f;
string str;
int cnt, pre[MAX];
int main() {
  int i, j, k, n;
  cin >> n >> str;
  int ans = 0, x = 0, f = 0, ff = 0;
  for (i = 0; i < n; i++)
    if (str[i] != '0') pre[++cnt] = str[i] - '0';
  if (cnt == 0) {
    puts("YES");
    return 0;
  }
  for (i = 1; i <= cnt; i++) {
    ans += pre[i], x = 0, f = 0;
    for (j = i + 1; j <= cnt; j++) {
      x += pre[j];
      if (x > ans) break;
      if (x == ans) {
        x = 0;
        if (j == cnt) f = 1;
      }
    }
    if (f) {
      ff = 1;
      break;
    }
  }
  if (!ff)
    puts("NO");
  else
    puts("YES");
  return 0;
}
