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