#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  string s;
  cin >> s;
  for (long long S = 0; S <= 9 * n; S++) {
    long long i = 0;
    long long cs = 0;
    for (auto c : s) {
      cs += (c - '0');
      if (cs == S) {
        i++;
        cs = 0;
      }
    }
    if (cs == 0 and i > 1) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
