#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string str;
  while (cin >> n >> str) {
    int sum1 = 0, sum2;
    bool flag = false;
    for (int i = 0; i < n - 1; ++i) {
      sum1 = sum1 + str[i] - '0';
      sum2 = 0;
      for (int j = i + 1; j < n; ++j) {
        sum2 = sum2 + str[j] - '0';
        if (sum1 == sum2) {
          flag = true;
          sum2 = 0;
        } else if (sum2 > sum1) {
          flag = false;
          break;
        }
      }
      if (flag and sum2 == 0) {
        cout << "YES" << endl;
        return 0;
      }
    }
    cout << "NO" << endl;
  }
  return 0;
}
