#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
long long cl(long double a) {
  if (a > (long long)a) {
    return (long long)a + 1;
  } else {
    return (long long)a;
  }
}
long long flr(long double a) { return (long long)a; }
void solve() {
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  long long pre[n];
  pre[0] = a[0];
  long long sum = a[0];
  for (long long i = 1; i < n; i++) {
    sum += a[i];
    pre[i] = pre[i - 1] + a[i];
  }
  if (sum % 2) {
    cout << "NO\n";
    return;
  }
  sum /= 2;
  map<long long, long long> op;
  map<long long, long long> oth;
  for (long long i = 0; i < n; i++) oth[a[i]]++;
  for (long long i = 0; i < n; i++) {
    if (pre[i] == sum) {
      cout << "YES\n";
      return;
    }
    op[a[i]] = true;
    oth[a[i]]--;
    if (pre[i] > sum) {
      if (op[pre[i] - sum]) {
        cout << "YES\n";
        return;
      }
    }
    if (pre[i] < sum) {
      if (oth[sum - pre[i]]) {
        cout << "YES\n";
        return;
      }
    }
  }
  cout << "NO\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  t = 1;
  while (t--) solve();
}
