#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n;
  cin >> n;
  vector<long long> a(n + 1, 0);
  long long S = 0;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    S += a[i];
  }
  if (S & 1) {
    cout << "NO" << endl;
    return 0;
  }
  map<long long, int> first, second;
  first[a[0]]++;
  for (long long i = 1; i < n; i++) {
    second[a[i]]++;
  }
  long long Sdash = 0;
  for (long long i = 0; i < n; i++) {
    Sdash += a[i];
    if (Sdash == S / 2) {
      cout << "YES" << endl;
      return 0;
    }
    if (Sdash < S / 2) {
      long long x = S / 2 - Sdash;
      if (second[x] > 0) {
        cout << "YES" << endl;
        return 0;
      }
    } else {
      long long y = Sdash - S / 2;
      if (first[y] > 0) {
        cout << "YES" << endl;
        return 0;
      }
    }
    first[a[i + 1]]++;
    second[a[i + 1]]--;
  }
  cout << "NO" << endl;
  return 0;
}
