#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using str = string;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using pd = pair<ld, ld>;
using vi = vector<int>;
using vb = vector<bool>;
using vc = vector<char>;
using vl = vector<ll>;
using vd = vector<ld>;
using vs = vector<str>;
using vpi = vector<pi>;
using vpl = vector<pl>;
using vpd = vector<pd>;
str tout[4] = {"No", "Yes", "NO", "YES"};
const ll M18 = 1e18;
const int M9 = 1e9;
const int N = 1e5;
int main() {
  int n;
  str s;
  cin >> n >> s;
  int ans = 2;
  for (int i = (0); i < (9 * 101); i++) {
    int f = 0, k = 0;
    for (auto& x : s) {
      f += (x - 48);
      if (f == i) f = 0, k++;
    }
    if (!f && k > 1) {
      ans++;
      break;
    }
  }
  cout << tout[(ans)];
}
