#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int sum = 0;
  int i, d, j;
  d = 0;
  for (i = 0; i < n; i++) {
    sum = sum + s[i] - 48;
  }
  for (i = 2; i <= n; i++) {
    if (sum % i == 0) {
      int suma, c;
      c = 0;
      suma = 0;
      for (j = 0; j < n; j++) {
        suma = suma + s[j] - 48;
        if (suma == (sum / i)) {
          suma = 0;
          c++;
        }
      }
      if (c == i) {
        cout << "YES";
        d++;
        break;
      }
    } else {
      continue;
    }
  }
  if (d == 0) {
    cout << "NO";
  }
  return 0;
}
