#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  string s;
  cin >> n >> s;
  for (int ssum = (0); ssum <= (9 * n); ssum++) {
    int cur = 0, ok = true, cnt = 0;
    for (auto c : s) {
      cur += c - '0';
      if (cur > ssum) {
        ok = false;
        break;
      } else if (cur == ssum) {
        cur = 0;
        cnt++;
      }
    }
    if (ok && cnt > 1 && cur == 0) {
      cout << "YES"
           << "\n";
      return 0;
    }
  }
  cout << "NO"
       << "\n";
  return 0;
}
