#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1.0);
const long double EPS = 1e-9;
const long long INF = 1e18;
const long long MOD = 1e9 + 7;
struct point {
  long long x, y;
  point() {}
  point(long long _x, long long _y) {
    x = _x;
    y = _y;
  }
  long long operator%(const point &other) { return x * other.x + y * other.y; }
  long long operator*(const point &other) { return x * other.y - y * other.x; }
  point operator-(const point &other) {
    return point(x - other.x, y - other.y);
  }
};
bool in(point a, point b, point pt, point zero) {
  a = a - zero;
  b = b - zero;
  pt = pt - zero;
  return (a * pt) * (a * b) >= 0 && (b * pt) * (b * a) >= 0;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.precision(6);
  long long n;
  cin >> n;
  vector<long long> a;
  for (long long i = 0; i < n; i++) {
    char x;
    cin >> x;
    if (x != '0') a.push_back(x - '0');
  }
  if (a.size() == 0) {
    cout << "YES";
    return 0;
  }
  n = a.size();
  for (long long i = 1; i <= 900; i++) {
    bool possible = true;
    long long cnt = 0;
    for (long long j = 0; j < n;) {
      long long ch = i;
      bool correct = true;
      cnt++;
      for (; j < n; j++) {
        if (ch - a[j] > 0) {
          ch -= a[j];
        } else if (ch - a[j] < 0) {
          correct = false;
          break;
        } else if (ch - a[j] == 0) {
          ch -= a[j];
          j++;
          break;
        }
      }
      if (!correct || ch != 0) {
        possible = false;
        break;
      }
    }
    if (possible && cnt > 1) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
