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