#include <bits/stdc++.h>
using namespace std;
bool isV(char ch) {
  return (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u');
}
void tc() {
  int n, m, x;
  cin >> n;
  string s;
  cin >> s;
  vector<int> v(n);
  int sum = 0;
  for (int i = 0; i < n; i++) {
    v[i] = s[i] - '0';
    sum += v[i];
  }
  for (int k = 2; k <= n; k++) {
    if (sum % k == 0) {
      x = sum / k;
      int csum = 0;
      int cnt = 0;
      bool f = true;
      int i = 0;
      while (i < n) {
        csum += v[i];
        if (csum == x) {
          csum = 0;
          cnt++;
        } else if (csum > x) {
          f = false;
          break;
        }
        i++;
      }
      if (f == true && cnt == k) {
        cout << "YES"
             << "\n";
        return;
      }
    }
  }
  cout << "NO"
       << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  tc();
  return 0;
}
