#include <bits/stdc++.h>
using namespace std;
ifstream in;
ofstream out;
const long long kk = 1000;
const long long MOD1 = 10e9 + 7;
const long long MOD2 = 10e9 + 9;
const long long MOD3 = 2 * 10e9 + 11;
long long n;
string s;
long long sum = 0;
bool answer = 0;
int main() {
  cin >> n;
  cin >> s;
  for (long long i = 0; i < n; i++) {
    sum += s[i] - '0';
  }
  long long q = 0;
  while (s[q] == '0') {
    q++;
  }
  if (q == n) {
    cout << "YES";
    return 0;
  }
  long long k = 0;
  for (long long i = q; i < n && k + s[i] - '0' < sum; i++) {
    k += s[i] - '0';
    if (sum % k == 0) {
      long long temp = 0;
      for (long long j = i + 1; j < n; j++) {
        temp += (s[j] - '0');
        if (temp > k) {
          break;
        }
        if (temp == k) {
          temp = 0;
        }
      }
      if (temp == 0) {
        cout << "YES";
        return 0;
      }
    }
  }
  cout << "NO";
  return 0;
}
