#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, sum = 0;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n; i++) sum += s[i] - '0';
  for (int i = 2; i <= n; i++) {
    if (sum % i == 0) {
      int cur = 0;
      bool flag = 1;
      for (int j = 0; j < n; j++) {
        cur += s[j] - '0';
        if (sum / i < cur) {
          flag = 0;
          break;
        }
        if (sum / i == cur) cur = 0;
      }
      if (flag) {
        cout << "YES";
        return 0;
      }
    }
  }
  cout << "NO";
  return 0;
}
