#include <bits/stdc++.h>
using namespace std;
vector<int> V(100);
int n;
bool f(int x) {
  if (x == 0) {
    bool res = true;
    for (int i = 0; i < n && res; i++)
      if (V[i] != 0) res = false;
    return res;
  }
  int i = 0;
  int curs = 0;
  while (i < n) {
    if (curs > x) {
      return false;
    } else if (curs == x) {
      curs = 0;
    } else {
      curs += V[i];
      i++;
    }
  }
  if (curs == 0 || curs == x) return true;
  return false;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  int s = 0;
  for (int i = 0; i < n; i++) {
    char c;
    cin >> c;
    V[i] = c - '0';
    s += V[i];
  }
  bool res = false;
  for (int q = 0; q <= s / 2 && !res; q++) {
    if (f(q)) res = true;
  }
  if (res)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
