#include <bits/stdc++.h>
using namespace std;
bool compare(long long a, long long b) { return a < b; }
int32_t main() {
  long long n;
  cin >> n;
  vector<long long> A(n + 5, 0);
  long long sum = 0;
  for (long long i = 0; i < n; i++) {
    cin >> A[i];
    sum = sum + A[i];
  }
  if (sum & 1) {
    cout << "NO" << endl;
    return 0;
  }
  map<long long, long long> first, second;
  first[A[0]] = 1;
  for (long long i = 1; i < n; i++) {
    second[A[i]]++;
  }
  long long sdash = 0;
  for (long long i = 0; i < n; i++) {
    sdash = sdash + A[i];
    if (sdash == sum / 2) {
      cout << "YES" << endl;
      return 0;
    }
    if (sdash < sum / 2) {
      long long x = sum / 2 - sdash;
      if (second[x] > 0) {
        cout << "YES" << endl;
        return 0;
      }
    } else {
      long long y = sdash - sum / 2;
      if (first[y] > 0) {
        cout << "YES" << endl;
        return 0;
      }
    }
    first[A[i + 1]]++;
    second[A[i + 1]]--;
  }
  cout << "NO" << endl;
  return 0;
}
