#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 50;
const long long INF = 0x3f3f3f3f;
const long long mod = 1e9 + 7;
int pre[120];
char s[120];
int n;
int check(int x) {
  int ret = 0;
  int last = 0;
  for (int i = 1; i <= n; i++) {
    if (pre[i] % x == 0 && pre[i] != 0 && pre[i] == x + last)
      ret++, last = pre[i];
  }
  if (ret >= 2 && pre[n] == ret * x)
    return 1;
  else
    return 0;
}
int main(int argc, char *argv[]) {
  if (argc == 2 && strcmp("-debug", argv[1]) == 0) {
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
  }
  cin >> n >> (s + 1);
  for (int i = 1; i <= n; i++) {
    pre[i] = pre[i - 1] + s[i] - '0';
  }
  if (pre[n] == 0 && n >= 2) {
    cout << "YES" << endl;
    return 0;
  }
  int flag = 0;
  for (int i = 1; i <= n; i++) {
    if (pre[i] == 0) continue;
    if (pre[n] % pre[i] != 0) continue;
    flag = check(pre[i]);
    if (flag == 1) {
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
  return 0;
}
