#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int a[n];
  long long Sum = 0;
  for (int i = 0; i < n; i++) {
    a[i] = s[i] - '0';
    Sum += a[i];
  }
  if (Sum == 0) {
    cout << "YES";
    return 0;
  }
  long long Now = 0;
  for (int i = 1; i < Sum; i++) {
    if (Sum % i == 0) {
      Now = 0;
      for (int j = 0; j < n; j++) {
        Now += a[j];
        if (Now == i) Now = 0;
      }
      if (Now == 0) {
        cout << "YES";
        return 0;
      }
    }
  }
  cout << "NO";
  return 0;
}
