#include <bits/stdc++.h>
using namespace std;
mt19937 rnd(228);
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  for (int sum = 0; sum <= 9 * n; sum++) {
    int it = 0;
    int cur = 0;
    for (auto c : s) {
      cur += c - '0';
      if (cur == sum) {
        it++;
        cur = 0;
      }
    }
    if (cur == 0 && it > 1) {
      cout << "YES\n";
      return 0;
    }
  }
  cout << "NO\n";
}
