#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  string m;
  cin >> m;
  vector<long long> v;
  set<long long> s;
  for (int i = 0; i < m.length(); i++) {
    if (m[i] - '0' != 0) v.push_back(m[i] - '0');
    s.insert(m[i] - '0');
  }
  if (s.size() == 1) {
    cout << "YES";
    return 0;
  }
  long long sum = 0;
  long long sum1 = 0;
  long long f = 0;
  for (int j = 0; j < v.size() - 1; j++) {
    sum = sum + v[j];
    sum1 = 0;
    long long flag = 0;
    for (int i = j + 1; i < v.size(); i++) {
      if (sum1 < sum) {
        sum1 = sum1 + v[i];
      }
      if (sum1 == sum) {
        sum1 = 0;
      }
      if (sum1 > sum) {
        flag = 1;
        break;
      }
    }
    if (flag == 0 && sum1 == 0) {
      f = 1;
      break;
    }
  }
  if (f == 1) {
    cout << "YES";
  } else {
    cout << "NO";
  }
}
