#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  string s;
  cin >> s;
  for (int i = 0; i < n; i++) v[i] = s[i] - '0';
  for (int i = 0; i < n * 9; i++) {
    int cnt = 0;
    int sum = 0;
    for (int j = 0; j < n; j++) {
      sum += v[j];
      if (sum > i) break;
      if (sum == i) {
        sum = 0;
        cnt++;
      }
    }
    if (sum == 0 && cnt > 1) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
}
