#include <bits/stdc++.h>
using namespace std;
void solve();
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  long long t;
  t = 1;
  while (t--) solve();
  return 0;
}
void solve() {
  long long n, a[105];
  char c;
  cin >> n;
  for (long long i = 1; i <= n; ++i) {
    cin >> c;
    a[i] = c - '0';
  }
  long long cur = 0;
  for (long long i = 1; i <= n - 1; ++i) {
    cur += a[i];
    long long ss = 0;
    bool f = 1;
    bool was = 0;
    for (long long j = i + 1; j <= n; ++j) {
      ss += a[j];
      if (ss == cur) ss = 0, was = 1;
      if (ss > cur) {
        f = 0;
        break;
      }
    }
    if (ss != 0 || !was) f = 0;
    if (f) {
      cout << "YES\n";
      return;
    }
  }
  cout << "NO\n";
}
