#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int sum = 0, l = 0;
  for (int i = 0; i < n; i++) {
    sum += s[i] - 48;
    l = i + 1;
    int S = 0;
    bool kk = 1;
    while (l < n) {
      S = s[l] - 48;
      l++;
      while (l < n && S + s[l] - 48 <= sum) {
        S += s[l] - 48;
        l++;
      }
      if (S != sum) kk = 0;
    }
    if (sum != S) kk = 0;
    if (kk) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
