#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  int n;
  cin >> n;
  int m[n];
  char x;
  long long int sum = 0;
  for (int i = 0; i < n; ++i) {
    cin >> x;
    m[i] = x - '0';
    sum += m[i];
  }
  for (int i = 2; i <= n; ++i) {
    if (sum % i == 0) {
      int g = 0;
      int len = 0;
      for (int j = 0; j < n; ++j) {
        if (g + m[j] > sum / i) {
          j = n + 3;
        } else if (g + m[j] == sum / i) {
          len += 1;
          g = 0;
        } else {
          g += m[j];
        }
      }
      if (len == i) {
        cout << "YES";
        return 0;
      }
    }
  }
  cout << "NO";
  return 0;
}
