#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
const int MAX = 1 << 19;
const long long MAX2 = 11;
const int MOD = 1000000000 + 7;
const long long INF = 20000;
const int dr[] = {1, 0, -1, 0, 1, 1, -1, -1};
const int dc[] = {0, 1, 0, -1, 1, -1, 1, -1};
const double pi = acos(-1);
const double EPS = 1e-9;
int n, x[105], y, z;
char c;
bool st;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long i = 1; i <= n; i++) cin >> c, c -= '0', x[i] = c, y += c;
  for (long long i = 2; i <= n; i++) {
    if (y % i) continue;
    y /= i;
    st = 1, z = 0;
    for (long long j = 1; j <= n; j++) {
      z += x[j];
      if (z > y) st = 0;
      if (z == y) z = 0;
    }
    if (st) return cout << "YES", 0;
    y *= i;
  }
  cout << "NO", 0;
  return 0;
}
