#include <bits/stdc++.h>
using namespace std;
int main() {
  int N = 0;
  string s;
  cin >> N >> s;
  map<char, int> number = {{'0', 0}, {'1', 1}, {'2', 2}, {'3', 3}, {'4', 4},
                           {'5', 5}, {'6', 6}, {'7', 7}, {'8', 8}, {'9', 9}};
  int curr_prefix = 0;
  for (int i = 0; i < N; i++) {
    curr_prefix += number[s[i]];
    int curr = 0;
    bool flag = false;
    for (int j = i + 1; j < N; j++) {
      curr += number[s[j]];
      if (curr == curr_prefix) {
        curr = 0;
        flag = true;
      }
    }
    if (curr == 0 && flag) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
