#include <bits/stdc++.h>
using namespace std;
int n, m[103];
string s;
int main() {
  cin >> n >> s;
  for (int i = 0; i < s.size(); i++) m[i] = s[i] - '0';
  for (int i = 0; i < n * 9; i++) {
    int sum = 0, hm = 0;
    for (int j = 0; j < n; j++) {
      sum += m[j];
      if (sum == i) sum = 0, hm++;
    }
    if (sum == 0 && hm > 1) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
}
