#include <bits/stdc++.h>
using namespace std;
const int N = 100 + 5;
long long a[N];
vector<int> v;
string s;
bool solve(int p, int sum) {
  int cur = 0;
  int cnt = 0;
  for (int i = 0; i < v.size(); i++) {
    cur += v[i];
    if (cur > sum) return 0;
    if (cur == sum) cur = 0, cnt++;
  }
  return (cur == 0 && cnt == p);
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  cin >> s;
  int sum = 0;
  for (auto i : s) v.push_back(i - '0'), sum += i - '0';
  if (sum == 0) return cout << "YES\n", 0;
  for (int i = 2; i <= n; i++) {
    if (sum % i != 0) continue;
    if (solve(i, sum / i)) return cout << "YES", 0;
  }
  cout << "NO";
  return 0;
}
