#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; i <= 900; i++) {
    int cursum = 0;
    bool bad = false;
    int more = 0;
    for (int j = 0; j < n; j++) {
      cursum += (s[j] - '0');
      if (cursum == i) {
        cursum = 0;
        more++;
      }
      if (cursum > i) {
        bad = true;
        break;
      }
    }
    if (cursum == 0 && !bad && more > 1) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
