#include <bits/stdc++.h>
using namespace std;
int a;
int a1[100000];
int bs(int arr[], int l, int r, int x) {
  while (l <= r) {
    int m = l + (r - l) / 2;
    if (arr[m] == x) return m;
    if (arr[m] < x)
      l = m + 1;
    else
      r = m - 1;
  }
  return -1;
}
int main() {
  int b = 0, c, d, i, j, k, l;
  string s;
  cin >> a;
  cin >> s;
  a1[0] = (int)s[0] - 48;
  for (i = 1; i < s.length(); i++) {
    a1[i] = a1[i - 1] + ((int)s[i] - 48);
  }
  l = a;
  for (i = a - 1; i >= 0; i--) {
    if (s[i] == '0')
      l--;
    else
      break;
  }
  if (a1[a - 1] == 0) {
    cout << "YES";
    return 0;
  }
  for (i = 0; i < l - 1; i++) {
    if (a1[a - 1] == 0) {
      cout << "YES";
      return 0;
    } else if (a1[i] == 0)
      i++;
    else if (a1[a - 1] % a1[i] == 0) {
      c = a1[a - 1] / a1[i];
      j = 0;
      d = 0;
      while (j < c) {
        if (bs(a1, 0, a, (j + 1) * a1[i]) == -1) {
          d = 1;
          break;
        } else
          j++;
      }
      if (d == 0) {
        cout << "YES";
        return 0;
      }
    }
  }
  cout << "NO";
}
