#include <bits/stdc++.h>
using namespace std;
long long a[100000];
map<long long, pair<long long, long long>> mp;
int main() {
  long long n;
  long long ls = 0, rs = 0;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    if (!mp.count(a[i]))
      mp[a[i]] = {i, i};
    else
      mp[a[i]].second = i;
    rs += (long long)a[i];
  }
  for (long long i = 0; i < n; i++) {
    ls += (long long)a[i];
    rs -= (long long)a[i];
    if (ls == rs) {
      cout << "YES";
      return 0;
    }
    if (ls < rs) {
      long long d = (rs - ls) >> 1;
      if ((rs - ls) & 1) continue;
      if (mp.count(d) && mp[d].second > i) {
        cout << "YES";
        return 0;
      }
    } else {
      long long d = (ls - rs) >> 1;
      if ((ls - rs) & 1) continue;
      if (mp.count(d) && mp[d].first <= i) {
        cout << "YES";
        return 0;
      }
    }
  }
  cout << "NO";
  return 0;
}
