#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  set<long long> s;
  vector<long long> vec;
  for (int i = 0; i < n; i++) {
    long long x;
    cin >> x;
    vec.push_back(x);
  }
  long long t1 = 0;
  for (int i = 0; i < n; i++) t1 += vec[i];
  if (t1 % 2 == 1) {
    cout << "NO";
    return 0;
  }
  long long tot = 0;
  long long half = t1 / 2;
  for (int i = 0; i < n; i++) {
    tot += vec[i];
    if (tot == half) {
      cout << "YES";
      return 0;
    }
    if (s.find(tot - half) != s.end()) {
      cout << "YES";
      return 0;
    }
    s.insert(vec[i]);
  }
  if (s.find(tot - half) != s.end()) {
    cout << "YES";
    return 0;
  }
  vector<long long> vec1;
  set<long long> s1;
  for (int i = n - 1; i >= 0; i--) vec1.push_back(vec[i]);
  long long tot2 = 0;
  for (int i = 0; i < n; i++) {
    tot2 += vec1[i];
    if (s1.find(tot2 - half) != s1.end()) {
      cout << "YES";
      return 0;
    }
    s1.insert(vec1[i]);
  }
  if (s1.find(tot - half) != s1.end()) {
    cout << "YES";
    return 0;
  }
  cout << "NO";
  return 0;
}
