#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, fr, i, j, x, y, z, w, flg = 0, sm = 0, tm = 0, a;
  map<long long, long long> mp, nq, qr;
  vector<long long> v;
  cin >> n;
  for (i = 1; i <= n; i++) {
    scanf("%lld", &a);
    sm = sm + a;
    mp[i] = sm;
    v.push_back(a);
  }
  for (i = n - 1; i >= 0; i--) {
    tm = tm + v[i];
    nq[i + 1] = tm;
  }
  for (i = 1; i <= n; i++) {
    qr[v[i - 1]] = 1;
    x = mp[i];
    y = sm - x;
    z = x - y;
    if (z % 2 == 0) {
      if (z == 0 || qr[z / 2] == 1) {
        flg = 1;
        break;
      }
    }
  }
  w = n - 1;
  for (i = n; i >= 1; i--) {
    qr[v[w]] = 2;
    x = nq[i];
    y = tm - x;
    z = x - y;
    if (z % 2 == 0) {
      if (z == 0 || qr[z / 2] == 2) {
        flg = 1;
        break;
      }
    }
    w--;
  }
  if (flg == 1)
    cout << "YES" << endl;
  else {
    cout << "NO" << endl;
  }
  return 0;
}
