#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using ld = long double;
const long long mod = 1e9 + 7;
const long double PI = acos(-1.0);
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ll n, sum = 0, ind1, ind2;
  cin >> n;
  vector<ll> arr(n);
  for (ll i = 0; i < n; cin >> arr[i++])
    ;
  vector<ll> prefix(n), suffix(n);
  sum = arr[0];
  prefix[0] = sum;
  for (ll i = 1; i < n; i++) {
    sum += arr[i];
    prefix[i] = sum;
  }
  ind1 = upper_bound(prefix.begin(), prefix.end(), sum / 2) - prefix.begin();
  sum = arr[n - 1];
  suffix[0] = sum;
  for (ll i = n - 2; i >= 0; i--) {
    sum += arr[i];
    suffix[n - 1 - i] = sum;
  }
  ind2 = upper_bound(suffix.begin(), suffix.end(), sum / 2) - suffix.begin();
  if (sum % 2 == 1) {
    cout << "NO" << endl;
    return 0;
  }
  if (*(lower_bound(prefix.begin(), prefix.end(), sum / 2)) == (sum / 2)) {
    cout << "YES" << endl;
    return 0;
  }
  bool possible = false;
  for (ll i = 0; i <= ind1; i++) {
    auto it = lower_bound(prefix.begin(), prefix.end(), sum / 2 + arr[i]);
    if (it != prefix.end() && *it == sum / 2 + arr[i]) possible = true;
  }
  for (ll i = 0; i <= ind2; i++) {
    auto it =
        lower_bound(suffix.begin(), suffix.end(), sum / 2 + arr[n - 1 - i]);
    if (it != suffix.end() && *it == sum / 2 + arr[n - 1 - i]) possible = true;
  }
  if (possible)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
