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