#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 0;
  string arr;
  cin >> n;
  cin.ignore();
  getline(cin, arr);
  int lucky = 0, sum = 0, flag = 0, flag1 = 0;
  for (int i = 0; i < arr.size() - 1; i++) {
    if (flag == 1) {
      break;
    }
    flag1 = 0;
    lucky += arr[i] - '0';
    sum = 0;
    for (int j = i + 1; j < arr.size(); j++) {
      sum += arr[j] - '0';
      if (sum > lucky) {
        if (sum - lucky != lucky) {
          break;
        }
      } else if (sum == lucky) {
        sum = 0;
        flag1 = 1;
      }
      if (flag1 == 1) {
        if (j == arr.size() - 1 && sum == 0) {
          flag = 1;
        }
      }
    }
  }
  if (flag == 1) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
  return 0;
}
