#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long a[n];
  long long prefixSum[n];
  long long sum = 0;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    prefixSum[i] = a[i];
    if (i != 0) {
      prefixSum[i] += prefixSum[i - 1];
    }
    sum += a[i];
  }
  if (sum % 2 == 1) {
    cout << "NO" << endl;
    return 0;
  }
  sum /= 2;
  multiset<long long> prefix;
  prefix.insert(a[0]);
  for (long long i = 1; i < n; i++) {
    prefix.insert(a[i]);
    long long tmp = prefixSum[i];
    long long tmp2 = tmp - sum;
    multiset<long long>::iterator it = prefix.find(tmp2);
    if (it != prefix.end()) {
      cout << "YES" << endl;
      return 0;
    }
  }
  reverse(a, a + n);
  long long prefixSum2[n];
  for (long long i = 0; i < n; i++) {
    prefixSum2[i] = a[i];
    if (i != 0) {
      prefixSum2[i] += prefixSum2[i - 1];
    }
  }
  multiset<long long> prefix2;
  prefix2.insert(a[0]);
  for (long long i = 1; i < n; i++) {
    prefix2.insert(a[i]);
    long long tmp = prefixSum2[i];
    long long tmp2 = tmp - sum;
    multiset<long long>::iterator it = prefix2.find(tmp2);
    if (it != prefix2.end()) {
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
  return 0;
}
