#include <bits/stdc++.h>
using namespace std;
vector<char> s;
signed main() {
  long long n;
  cin >> n;
  if (n == 1) {
    cout << "NO\n";
    return 0;
  }
  for (long long i = 0; i < n; i++) {
    char c;
    cin >> c;
    s.emplace_back(c);
  }
  bool flag = 0;
  long long sum = 0, zero = 0;
  for (long long i = 0; i < s.size(); i++) {
    sum += s[i] - '0';
  }
  if (sum == 0) {
    cout << "YES\n";
    return 0;
  }
  while (s.back() == '0') s.pop_back();
  for (long long i = 0; i <= 900; i++) {
    if (i - zero == sum) {
      break;
    }
    long long now = 0;
    for (long long j = 0; j < s.size(); j++) {
      now += s[j] - '0';
      if (now > i)
        break;
      else if (now == i) {
        now = 0;
        if (j == s.size() - 1) {
          flag = 1;
          break;
        }
      }
    }
    if (flag) break;
  }
  if (flag) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
}
