#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
long long m, l, r, n, q, j, i, cr, cl, c, cnt, k;
long long ar[200005];
long long br[200005];
int kaj = 2e6 + 5;
int arr[200005];
int main() {
  map<long long, long long> mp, lmp;
  long long sm = 0;
  scanf("%lld", &n);
  for (long long i = 0; i < n; i++) {
    scanf("%lld", &ar[i]);
    sm += ar[i];
    mp[ar[i]]++;
  }
  long long lf = 0;
  if (sm % 2) {
    cout << "NO";
  } else {
    long long rsm = sm;
    sm /= 2;
    for (i = 0; i < n; i++) {
      lf += ar[i];
      mp[ar[i]]--;
      lmp[ar[i]]++;
      rsm -= ar[i];
      if (lf < sm && mp[sm - lf] || rsm < sm && lmp[sm - rsm]) {
        cout << "YES";
        return 0;
      }
    }
    cout << "NO";
  }
}
