#include <bits/stdc++.h>
const int MaxN = 1e5;
using namespace std;
int a[MaxN + 5];
long long sum = 0;
int n;
map<long long, int> G;
map<long long, int> P;
void Init() {
  G.clear();
  sum = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    G[a[i]] = i;
    sum += a[i];
  }
  for (int i = n; i >= 1; i--) {
    P[a[i]] = i;
  }
}
void Solve() {
  if (sum & 1) {
    cout << "NO" << endl;
    return;
  }
  long long t = 0;
  bool ok = 0;
  long long ave = sum / 2;
  G[0] = n + 1;
  for (int i = 1; i <= n; i++) {
    t += a[i];
    if (t > ave) break;
    if (G[ave - t] > i) {
      ok = 1;
      break;
    }
  }
  t = 0;
  for (int i = n; i >= 1; i--) {
    t += a[i];
    if (t > ave) break;
    if (P[ave - t] < i && P[ave - t] != 0) {
      ok = 1;
      break;
    }
  }
  if (ok || G[sum / 2] != 0)
    cout << "YES\n";
  else
    cout << "NO\n";
}
int main() {
  while (~scanf("%d", &n)) {
    Init();
    Solve();
  }
}
