#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  bool flag = true;
  cin >> n;
  string s;
  cin >> s;
  if (s.length() == 1 && s[0] == '0') {
    cout << 0 << endl;
  } else {
    int nums = 0;
    for (int i = 0; i < s.length(); i++) {
      nums += s[i] - '0';
    }
    for (int i = 0; i <= nums / 2; i++) {
      int sum = 0;
      int part = 0;
      flag = true;
      for (int o = 0; o < s.length(); o++) {
        if (sum > i || s[o] - '0' > i) {
          flag = false;
          break;
        } else {
          sum += s[o] - '0';
          if (sum == i) {
            sum = 0;
            part++;
          }
        }
      }
      if (sum != 0 || part < 2) {
        flag = false;
      }
      if (flag) {
        break;
      }
    }
    cout << (flag ? "YES" : "NO") << endl;
  }
}
