#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a;
  a.resize(n);
  string q;
  cin >> q;
  for (int i = 0; i < n; i++) {
    a[i] = q[i] - '0';
  }
  int sum = 0;
  for (int i = 0; i < n; i++) {
    sum += a[i];
    int k = i + 1, j;
    while (k != n) {
    toup:
      j = k;
      int s1 = 0;
      while (j < n) {
        s1 += a[j];
        if (s1 == sum) {
          j++;
          while (j != n && a[j] == 0) j++;
          k = j;
          if (k != n)
            goto toup;
          else
            break;
        } else if (s1 > sum) {
          goto bbreak;
        }
        j++;
      }
      if (s1 == sum) {
        cout << "YES";
        return 0;
      } else {
        break;
      }
    }
  bbreak:
    int u = 0;
  }
  cout << "NO";
}
