#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string m;
  cin >> m;
  int arr[m.length()];
  int count = 0;
  for (int x = 0; x < m.length(); x++) {
    int a = m[x] - '0';
    arr[x] = a;
    count = count + a;
  }
  if (count == 0) {
    cout << "YES";
    return 0;
  }
  for (int x = 2; x <= count; x++) {
    if (count % x == 0) {
      int curr = count / x;
      int seccount = 0;
      int isx = 0;
      for (int x = 0; x < m.length(); x++) {
        seccount = seccount + arr[x];
        if (seccount == curr) {
          isx++;
          seccount = 0;
        }
      }
      if (isx == x && seccount == 0) {
        cout << "YES";
        return 0;
      }
    }
  }
  cout << "NO";
}
