#include <bits/stdc++.h>
const int inf = 1e9;
const int dx[] = {0, 1, -1, 0};
const int dy[] = {-1, 0, 0, 1};
long long a[100001] = {0};
long long a2[100001] = {0};
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long x, y = 0, z = 0, a = 0, t, b, c, d, f = 0;
  string s;
  cin >> x;
  cin >> s;
  for (int i = 0; i < 900; i++) {
    int sum = 0;
    int parts = 0;
    for (int j = 0; j < s.size(); j++) {
      sum += s[j] - '0';
      if (sum == i) {
        parts++;
        sum = 0;
      }
    }
    if (parts > 1 && sum == 0) {
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
}
