#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, i, j;
  cin >> n;
  long long int a[n], s = 0;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    s += a[i];
  }
  if (s % 2) {
    cout << "NO\n";
    return 0;
  }
  s /= 2;
  long long int ss = 0;
  map<long long int, long long int> mp;
  for (j = 0; j <= n - 1; j++) {
    ss += a[j];
    mp[a[j]]++;
    if (mp[ss - s]) {
      cout << "YES\n";
      return 0;
    }
  }
  ss = 0;
  mp.clear();
  for (j = n - 1; j >= 0; j--) {
    ss += a[j];
    mp[a[j]]++;
    if (mp[ss - s]) {
      cout << "YES\n";
      return 0;
    }
  }
  cout << "NO\n";
}
