#include <bits/stdc++.h>
using namespace std;
int n, dp[105], sum[105];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%1d", &sum[i]);
    sum[i] += sum[i - 1];
  }
  for (int i = 0; i < sum[n]; i++) {
    memset(dp, false, sizeof dp);
    dp[0] = true;
    for (int j = 1; j <= n; j++) {
      for (int k = j; k; k--) {
        if (dp[k - 1] == true && sum[j] - sum[k - 1] == i) {
          dp[j] = true;
          break;
        }
      }
    }
    if (dp[n] == true) {
      cout << "YES" << endl;
      return 0;
    }
  }
  if (sum[n] == 0) {
    cout << "YES" << endl;
    return 0;
  }
  cout << "NO" << endl;
  return 0;
}
