#include <bits/stdc++.h>
using namespace std;
int n;
string s;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  cin >> s;
  int su = 0;
  for (int i = 0; i < n; i++) {
    su += ((int)s[i] - (int)'0');
  }
  if (su == 0) {
    cout << "YES" << endl;
    return 0;
  }
  for (int i = 1; i < su; i++) {
    int sum = 0;
    for (int j = 0; j < n; j++) {
      sum += ((int)s[j] - (int)'0');
      if (sum > i) break;
      if (sum == i) sum = 0;
    }
    if (sum == 0) {
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
}
