#include <bits/stdc++.h>
const int inf = INT_MAX;
const int mod = 1e9 + 7;
const int maxn = 1e5 + 111;
using namespace std;
int n, sum = 0;
string second;
int main() {
  cin >> n >> second;
  for (int i = 0; i < n; i++) sum += (second[i] - '0');
  for (int i = 2; i <= n; i++) {
    bool ch = true;
    if (sum % i != 0) ch = false;
    int h = sum / i;
    int k = 0;
    for (int j = 0; j < n; j++) {
      k += (second[j] - '0');
      if (k > h) {
        ch = false;
        break;
      }
      if (k == h) k = 0;
    }
    if (ch) {
      puts("YES");
      return 0;
    }
  }
  puts("NO");
}
