#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int ar[n - 1];
  long sum = 0;
  int flag3 = 0;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] != '0') {
      flag3 = 1;
    } else if (flag3 == 1 and s[i] == '0') {
      s.erase(i, 1);
      i--;
    }
  }
  for (int i = 0; i < s.length() - 1; i++) {
    sum = sum + (int)s[i] - 48;
    ar[i] = sum;
  }
  sum = sum + (int)s[s.length() - 1] - 48;
  int flag1;
  for (int i = 0; i < s.length() - 1; i++) {
    flag1 = 0;
    if (ar[i] == 0) {
      int flag2 = 0;
      for (int i = 0; i < s.length(); i++) {
        if (s[i] != '0') {
          flag2 = 1;
          break;
        }
      }
      if (flag2 == 0) {
        flag1 = 1;
      }
    } else if (sum % ar[i] == 0) {
      int j = i + 1;
      while (j < s.length()) {
        int flag = 0;
        int sum1 = 0;
        while (sum1 < ar[i]) {
          sum1 = sum1 + (int)s[j] - 48;
          j++;
          if (sum1 == ar[i]) {
            break;
          } else if (sum1 > ar[i]) {
            flag = 1;
            break;
          }
        }
        if (flag == 1)
          break;
        else if (flag == 0 and j == s.length()) {
          flag1 = 1;
          break;
        }
      }
    }
    if (flag1 == 1) {
      cout << "YES";
      break;
    }
  }
  if (flag1 != 1) cout << "NO";
  return 0;
}
