#include <bits/stdc++.h>
using namespace std;
int main() {
  char s[1005], s2[1006];
  int t;
  cin >> t;
  cin >> s;
  int sum = 0;
  int sum2 = 0;
  int flag;
  int len = strlen(s);
  s[len] = '\0';
  for (int i = 0; i < len; i++) sum2 = sum2 + s[i] - '0';
  if (sum2 == 0) {
    if (t == 1)
      cout << "NO\n";
    else
      cout << "YES\n";
    return 0;
  }
  int j = 0;
  for (int i = 0; i < len; i++) {
    if (s[i] != '0') {
      s2[j] = s[i];
      j++;
    }
  }
  s2[j] = '\0';
  strcpy(s, s2);
  len = strlen(s);
  s[len] = '\0';
  for (int i = 1; i <= 1000; i++) {
    flag = 0;
    sum = 0;
    for (int j = 0; j < len; j++) {
      sum = sum + s[j] - '0';
      if (sum == i) {
        if (j == len - 1) {
          if (sum2 == sum) {
            flag = 2;
          } else {
            flag = 1;
          }
          break;
        }
        sum = 0;
      } else if (sum > i) {
        sum = 0;
        flag = 2;
        break;
      }
    }
    if (flag == 1) {
      cout << "YES\n";
      return 0;
    } else if (flag == 2) {
      continue;
    }
  }
  if (flag != 1) cout << "NO\n";
}
