#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int pref_sum[n];
  pref_sum[0] = s[0] - '0';
  for (int i = 1; i < n; i++) {
    pref_sum[i] = pref_sum[i - 1] + s[i] - '0';
  }
  bool flag = 0;
  for (int i = 0; i < n - 1; i++) {
    int sum = 0, cnt = 0;
    for (int j = 0; j < n; j++) {
      sum += s[j] - '0';
      if (sum == pref_sum[i]) {
        sum = 0;
        cnt++;
      }
    }
    if (sum == 0 && cnt >= 2) {
      flag = 1;
      break;
    }
  }
  if (flag)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
