#include <bits/stdc++.h>
using namespace std;
static int aQWEs = []() -> int {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  return 0;
}();
long long int power(long long int a, long long int p,
                    long long int m = 1000000007) {
  a %= m;
  long long int val = 1;
  while (p > 0) {
    if (p & 1) {
      val = (val * a) % m;
    }
    a = (a * a) % m;
    p >>= 1;
  }
  return (val);
}
int main() {
  long long int i, j;
  int T = 1;
  while (T--) {
    int n;
    cin >> n;
    std::vector<long long int> v(n);
    long long int h = 0;
    for (i = 0; i < n; ++i) {
      cin >> v[i];
      h += v[i];
    }
    if (h & 1) {
      cout << "NO\n";
      ;
      continue;
    }
    h >>= 1;
    long long int sum = 0;
    set<long long int> st;
    for (i = 0; i < n; ++i) {
      sum += v[i];
      st.insert(v[i]);
      if (st.find(sum - h) != st.end()) break;
    }
    if (i < n) {
      cout << "YES\n";
      ;
      continue;
    }
    sum = 0;
    st.clear();
    for (i = n - 1; i >= 0; --i) {
      sum += v[i];
      st.insert(v[i]);
      if (st.find(sum - h) != st.end()) break;
    }
    if (i >= 0) {
      cout << "YES\n";
      ;
    } else {
      cout << "NO\n";
      ;
    }
  }
}
