#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[101], t = 0;
  string s;
  cin >> n >> s;
  for (int i = 0; i < s.length(); i++) a[++t] = s[i] - '0';
  int sum[101];
  memset(sum, 0, sizeof(sum));
  for (int i = 1; i <= n; i++) sum[i] = sum[i - 1] + a[i];
  for (int i = 1; i < n; i++) {
    int ans = 0, cnt = 0;
    bool flag = true;
    for (int j = i + 1; j <= n; j++) {
      ans += a[j];
      if (ans == sum[i]) {
        flag = true;
        ans = 0;
        cnt++;
      }
      if (ans && ans > sum[i]) flag = false;
      if (ans && ans < sum[i]) flag = false;
      if (cnt == 0) flag = false;
    }
    if (flag) {
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
}
