#include <bits/stdc++.h>
using namespace std;
struct Dbg {
  template <typename T>
  Dbg& operator,(const T& v) {
    cerr << v << ", ";
    return *this;
  }
} Dbg;
template <typename T>
ostream& operator<<(ostream& _o_, const vector<T>& _v_) {
  if (!_v_.empty()) {
    _o_ << '[';
    copy(_v_.begin(), _v_.end(), ostream_iterator<T>(_o_, ", "));
    _o_ << "\b\b]";
  }
  return _o_;
}
template <class C>
void mini(C& _a, C _b) {
  _a = min(_a, _b);
}
template <class C>
void maxi(C& _a, C _b) {
  _a = max(_a, _b);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  string s;
  cin >> n >> s;
  for (int i = 0; i <= 900; i++) {
    int sum = 0, cnt = 0;
    for (int j = 0; j < n; j++) {
      sum += (s[j] - '0');
      if (sum == i) {
        cnt++;
        sum = 0;
      }
    }
    if (cnt >= 2 && sum == 0) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
