#include <bits/stdc++.h>
using namespace std;
int n;
char a[110];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  int sum = 0, s = 0, cnt, flag = 0;
  cin >> a;
  for (int i = 0; i < n; ++i) {
    sum += a[i] - '0';
    cnt = 1;
    s = 0;
    for (int j = i + 1; j < n; ++j) {
      s += a[j] - '0';
      if (s == sum) {
        cnt++;
        s = 0;
      } else if (s > sum) {
        break;
      }
    }
    if (s == 0 && cnt >= 2) flag = 1;
  }
  if (flag) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
  return 0;
}
