#include <bits/stdc++.h>
using namespace std;
bool Prov(vector<int> A, int k) {
  int n = A.size(), q;
  for (int i = 0; i < n; i++) {
    q = 0;
    while (q < k && i < n) {
      q += A[i];
      i++;
    }
    if (q != k)
      return false;
    else
      i--;
  }
  return true;
}
int main() {
  string B;
  vector<int> A;
  int n, s;
  cin >> n;
  cin >> B;
  for (int i = 0; i < n; i++)
    if (B[i] != '0') A.push_back(B[i] - '0');
  n = A.size();
  if (n == 0) {
    cout << "YES";
    return 0;
  }
  for (int i = 1; i < n; i++) {
    s = 0;
    for (int j = 0; j < i; j++) {
      s += A[j];
    }
    if (Prov(A, s)) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
