#include <bits/stdc++.h>
using namespace std;
long long int inf = 2e14;
long long int mod = 1e9 + 7;
char en = '\n';
long long int arr[105];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  long long int sum1 = 0;
  string s;
  cin >> s;
  for (long long int i = 1; i <= n; i++) {
    arr[i] = s[i - 1] - '0';
    sum1 += arr[i];
  }
  if (sum1 == 0) {
    cout << "YES" << endl;
    return 0;
  }
  for (long long int i = 1; i <= (sum1 - 1); i++) {
    if ((sum1 % i) == 0) {
      long long int flag = 0;
      long long int curr = 0;
      for (long long int j = 1; j <= n; j++) {
        curr += arr[j];
        if (curr > i) {
          flag = 1;
          break;
        }
        if (curr == i) {
          curr = 0;
        }
      }
      if ((curr != 0) or (flag)) continue;
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
  return 0;
}
