#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long test = 1;
  while (test--) {
    long long n;
    cin >> n;
    string s;
    cin >> s;
    long long sum = 0;
    bool ans = 0;
    for (long long i = 0; i < s.length() - 1; i++) {
      sum += s[i] - '0';
      long long next_sum = 0;
      vector<long long> vec;
      for (long long j = i + 1; j < s.length(); j++) {
        next_sum += s[j] - '0';
        if (j == s.length() - 1) {
          if (next_sum == sum) vec.push_back(next_sum), next_sum = 0;
        }
        if (next_sum > sum) break;
        if (next_sum == sum) vec.push_back(next_sum), next_sum = 0;
      }
      if (next_sum == 0 and vec.size()) ans = 1;
    }
    cout << (ans ? "YES" : "NO") << '\n';
  }
  return 0;
}
