#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 7;
char a[maxn];
bool vis[maxn * 9];
int t, bj = 1, ans, mod, num = 0, len;
int main() {
  scanf("%d", &len);
  cin >> a;
  for (int i = 0; i < len; i++) {
    num += a[i] - '0';
    vis[num] = 1;
  }
  if (num == 0) {
    cout << "YES" << endl;
    return 0;
  }
  for (int i = 2; i <= len; i++)
    if (num % i == 0) {
      bj = 1;
      mod = num / i;
      for (int j = mod; j <= num; j += mod)
        if (!vis[j]) {
          bj = 0;
          break;
        }
      if (bj) {
        ans = 1;
        break;
      }
    }
  if (ans)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
