#include <bits/stdc++.h>
using namespace std;
int posit(string &s, int pos_, int sum_) {
  int su = 0;
  for (int i = pos_; i < s.size(); i++) {
    su += (s[i] - '0');
    if (su == sum_) return i;
  }
  return -1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  string s;
  cin >> s;
  string s_ = "";
  for (int i = 0; i < s.size(); i++)
    if (s[i] != '0') s_ += s[i];
  s = s_;
  if (s.size() == 0) {
    cout << "YES";
    return 0;
  }
  vector<int> a(s.size() + 1);
  a[0] = s[0] - '0';
  for (int i = 1; i < s.size(); i++) a[i] = a[i - 1] + (s[i] - '0');
  for (int i = 0; i < s.size() - 1; i++) {
    int sum_ = a[i];
    int pos_ = i;
    while (pos_ != -1) {
      if (pos_ == s.size() - 1) {
        cout << "YES";
        return 0;
      } else if (pos_ < s.size() && pos_ != -1)
        pos_ = posit(s, pos_ + 1, sum_);
    }
  }
  cout << "NO";
}
