#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  vector<long long> arr(n, 0);
  vector<long long> pref(n, 0);
  vector<long long> suff(n, 0);
  map<long long, long long> pre;
  map<long long, long long> suf;
  for (long long i = 0; i < n; i++) cin >> arr[i];
  pref[0] = arr[0];
  suff[n - 1] = arr[n - 1];
  for (long long i = 1; i < n; i++) pref[i] = pref[i - 1] + arr[i];
  for (long long i = n - 2; i >= 0; i--) suff[i] = suff[i + 1] + arr[i];
  if (pref[n - 1] % 2 != 0) {
    cout << "NO\n";
    return 0;
  }
  for (long long i = n - 1; i >= 0; i--) suf[arr[i]]++;
  long long fl = 0;
  for (long long i = 0; i < n - 1; i++) {
    long long a = pref[i];
    if (suf[arr[i]] == 1)
      suf.erase(suf.find(arr[i]));
    else
      suf[arr[i]]--;
    pre[arr[i]]++;
    long long b = suff[i + 1];
    if (1) {
      long long temp = suff[i + 1] + arr[i];
      long long diff = temp - pref[n - 1] / 2;
      if (suf.find(diff) != suf.end()) {
        fl = 1;
        break;
      }
    }
    if (a == b) {
      fl = 1;
      break;
    }
    if (1) {
      long long temp = pref[i] + arr[i + 1];
      long long diff = temp - pref[n - 1] / 2;
      if (pre.find(diff) != pre.end()) {
        fl = 1;
        break;
      }
    }
  }
  if (!fl)
    cout << "NO\n";
  else
    cout << "YES\n";
  return 0;
}
