#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const int inf = 1e9;
const int mod = 1e9 + 7;
const double EPS = (double)1e-9;
const double pi = acos(-1.0);
const int MAXN = 2e5 + 5;
int n;
int a[MAXN];
int SUM;
bool f(int x) {
  if (x == SUM) return 0;
  int sum = 0;
  for (int i = 1; i <= n; i++) {
    sum += a[i];
    if (sum == x)
      sum = 0;
    else if (sum > x)
      return 0;
  }
  if (sum == 0)
    return 1;
  else
    return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << setprecision(9) << fixed;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    char x;
    cin >> x;
    a[i] = x - '0';
    SUM += a[i];
  }
  for (int i = 0; i <= 9 * n; i++) {
    if (f(i)) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
