#include <bits/stdc++.h>
using namespace std;
int n;
string s;
int main() {
  {
    cin >> n >> s;
    int sum = 0;
    for (char c : s) {
      sum += c - '0';
    }
    if (sum == 0) {
      if (n == 1) {
        cout << "NO\n";
      } else {
        cout << "YES\n";
      }
      return 0;
    }
    for (int i = 1; i * 2 <= sum; ++i) {
      if (sum % i != 0) continue;
      int cnt = 0, cur = 0;
      for (char c : s) {
        cur += c - '0';
        if (cur == i) {
          cur = 0;
          ++cnt;
        }
      }
      if (cur == 0) {
        cout << "YES\n";
        return 0;
      }
    }
    cout << "NO\n";
  }
  return 0;
}
