#include <bits/stdc++.h>   using namespace std;   map<long long, long long> dd;   map<long long, long long> tong;   int main() {     long long n;     cin >> n;     string s;     cin >> s;     long long sum = 0;     for (long long i = 0; i < s.size(); i++) {       sum += (s[i] -  0 );     }     for (long long i = 2; i <= s.size(); i++) {       if (sum % i == 0) {         long long tmp = sum / i, dem = 0;         long long sum1 = 0;         for (long long j = 0; j < s.size(); j++) {           sum1 += (s[j] -  0 );           if (sum1 == tmp) {             sum1 = 0;             dem++;           }         }         if (dem == i) {           cout <<  YES ;           return 0;         }       }     }     cout <<  NO ;   }   