#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
struct Point {
  int x, y;
};
int main() {
  ios_base::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  cout.precision(20);
  cout << fixed;
  int n;
  cin >> n;
  string s;
  cin >> s;
  bool flag = 0;
  for (int sum = 0; sum < 10000; sum++) {
    int cur = 0, fl = 1, cnt = 0;
    for (int i = 0; i < n; i++) {
      cur += s[i] - '0';
      if (cur == sum) cur = 0, cnt++;
      if (cur > sum) fl = 0;
    }
    if (cur || cnt == 1) fl = 0;
    if (fl) {
      flag = 1;
    }
  }
  cout << (flag ? "YES" : "NO");
}
