#include <bits/stdc++.h>
using namespace std;
int sum(string a) {
  int d = 0;
  for (auto i : a) d += i - 48;
  return d;
}
int main() {
  int n;
  string a;
  cin >> n >> a;
  for (int j = 1; j < n; j++) {
    string s = a.substr(0, j);
    int s2 = 0, e = sum(s), l = 0, l2 = 0;
    for (int z = j; z < n; z++) {
      s2 += a[z] - 48;
      if (s2 == e) {
        l2 = 1;
        s2 = 0;
      } else if (s2 > e) {
        l = 1;
        break;
      }
    }
    if (!l && !s2 && l2) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
}
