#include <bits/stdc++.h>
const long long inf = 1e18;
using namespace std;
vector<long long> v, root;
long long cnt = 0;
unsigned intl;
void makeset(long long u) { root[u] = u; }
long long find(long long u) {
  if (root[u] != u) {
    return root[u] = find(root[u]);
  }
  return u;
}
void update(long long u, long long v) {
  long long a = find(u), b = find(v);
  if (a == b) {
    return;
  }
  root[b] = a;
  return;
}
int main() {
  long long n;
  cin >> n;
  vector<long long> pref(1), v(n);
  pref[0] = 0;
  map<long long, long long> check, check1;
  long long sum = 0;
  for (long long i = 0; i < n; i++) {
    cin >> v[i];
    sum += v[i];
  }
  if (sum % 2 != 0) {
    cout << "NO"
         << "\n";
    return 0;
  }
  long long sum1 = 0;
  for (long long i = 0; i < n; i++) {
    sum1 += v[i];
    sum -= v[i];
    check[v[i]] = 1;
    if (check[(sum1 - sum) / 2] == 1) {
      cout << "YES"
           << "\n";
      return 0;
    }
  }
  reverse(v.begin(), v.end());
  for (long long i = 0; i < n; i++) {
    sum1 -= v[i];
    sum += v[i];
    check1[v[i]] = 1;
    if (check1[(sum - sum1) / 2] == 1) {
      cout << "YES"
           << "\n";
      return 0;
    }
  }
  cout << "NO"
       << "\n";
  return 0;
}
