#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
const int N = (int)5e5 + 7;
const int inf = (int)1e9 + 7;
const int mod = (int)1e9 + 7;
const long long linf = (long long)1e18 + 7;
const int dx[] = {-1, 0, 1, 0, 1, -1, -1, 1};
const int dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
using namespace std;
int n, k;
int a[N];
int tmr;
int was[N][3];
int dp[N][3];
bool calc(int v = 1, int first = 0) {
  if (v > n) return first > 1;
  if (was[v][first] == tmr) return dp[v][first];
  was[v][first] = tmr;
  int sum = 0;
  int res = 0;
  for (int i = (v); i <= (n); i++) {
    sum += a[i];
    if (sum == k) res |= calc(i + 1, min(2, first + 1));
    if (res || sum > k) break;
  }
  return dp[v][first] = res;
}
int main() {
  ios_base ::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  string second;
  cin >> second;
  for (int i = (1); i <= (n); i++) {
    a[i] = second[i - 1] - '0';
    a[0] += a[i];
  }
  for (int i = (0); i <= (a[0]); i++) {
    k = i;
    ++tmr;
    if (calc()) {
      cout << "YES", exit(0);
    }
  }
  cout << "NO";
  exit(0);
}
