#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string first;
  cin >> first;
  int a[n];
  for (int i = 0; i < first.size(); i++) a[i] = first[i] - '0';
  for (int k = 0; k < n - 1; k++) {
    int sum = 0;
    for (int i = 0; i <= k; i++) sum += a[i];
    int index = k + 1;
    while (index < n) {
      int s = 0;
      for (int i = index; i < n; i++) {
        s += a[i];
        if (s == sum) {
          index = i + 1;
          break;
        }
      }
      if (index == n) {
        cout << "YES";
        return 0;
      }
      bool b = 0;
      for (int i = index; i < n; i++)
        if (a[i] != 0) {
          b = 1;
        }
      if (b == 0 && index != k + 1) {
        cout << "YES";
        return 0;
      }
      if (s != sum) index = n;
    }
  }
  cout << "NO";
  return 0;
}
