#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    int sum = 0;
    for (int j = 0; j <= i; j++) {
      sum += (s[j] - '0');
    }
    int sum1 = 0;
    bool flag = true;
    bool check = false;
    for (int j = i + 1; j < n; j++) {
      sum1 += (s[j] - '0');
      if (sum1 > sum) {
        flag = false;
        break;
      }
      if (j != n - 1) {
        if (sum1 == sum && s[j + 1] == '0') continue;
      }
      if (sum1 == sum) {
        sum1 = 0;
        if (j == n - 1) check = true;
      }
    }
    if (check) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
