#include <bits/stdc++.h>
using namespace std;
inline bool isvowel(char ch) {
  ch = tolower(ch);
  return (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' ||
          ch == 'y');
}
inline bool isprime(int n) {
  if (n < 2 || (n % 2 == 0 && n != 2)) return false;
  for (int i = 3; i * i <= n; i += 2)
    if (n % i == 0) return false;
  return true;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
  int n, i, j;
  string s;
  cin >> n >> s;
  int sum = 0;
  for (auto to : s) {
    sum += (to - '0');
  }
  for (i = 1; i * i <= sum; i++) {
    if (sum % i == 0) {
      int total = 0, cnt = 0, it = 0;
      for (auto to : s) {
        cnt += (to - '0');
        if (cnt == i) {
          total += i;
          cnt = 0;
          it++;
        }
      }
      if (total == sum && it > 1) {
        cout << "YES";
        return 0;
      }
      total = cnt = it = 0;
      for (auto to : s) {
        cnt += (to - '0');
        if (cnt == sum / i) {
          total += sum / i;
          cnt = 0;
          it++;
        }
      }
      if (total == sum && it > 1) {
        cout << "YES";
        return 0;
      }
    }
  }
  if (sum == 0)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
