#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
long long binarySearch(vector<long long> arr, long long l, long long r,
                       long long x) {
  if (r >= l) {
    long long mid = l + (r - l) / 2;
    if (arr[mid] == x) return mid;
    if (arr[mid] > x) return binarySearch(arr, l, mid - 1, x);
    return binarySearch(arr, mid + 1, r, x);
  }
  return -1;
}
int main() {
  fast();
  int n;
  string s;
  cin >> n >> s;
  int sum = 0;
  for (int i = 0; i < n - 1; ++i) {
    sum += s[i] - '0';
    bool ok = true;
    int pos = i + 1;
    int sum2 = 0;
    while (pos < n) {
      sum2 = s[pos++] - '0';
      while (pos < n && sum2 + s[pos] - '0' <= sum) {
        sum2 += s[pos] - '0';
        ++pos;
      }
      if (sum2 != sum) ok = false;
    }
    if (sum2 != sum) ok = false;
    if (ok) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
