#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
const long long MOD = 1e9 + 7;
long long a[MAXN];
long long pref[MAXN];
long long suff[MAXN];
int n;
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    pref[i] += a[i];
    if (i) pref[i] += pref[i - 1];
  }
  for (int i = n - 1; i >= 0; --i) {
    suff[i] += a[i];
    if (i + 1 < n) suff[i] += suff[i + 1];
  }
  if (pref[n - 1] % 2 != 0) {
    cout << "NO\n";
    return 0;
  }
  map<long long, long long> was;
  for (int i = 0; i < n; ++i) {
    was[a[i]] = 1;
    long long s1 = pref[i];
    long long s2 = pref[n - 1] - s1;
    long long x = s1 - s2;
    if (x == 0) {
      cout << "YES\n";
      return 0;
    }
    if (x % 2 == 0) {
      if (was.find(x / 2) != was.end()) {
        cout << "YES\n";
        return 0;
      }
    }
  }
  map<long long, long long> was1;
  for (int i = n - 1; i >= 0; --i) {
    was1[a[i]] = 1;
    long long s1 = suff[i];
    long long s2 = suff[0] - s1;
    long long x = s1 - s2;
    if (x == 0) {
      cout << "YES\n";
      return 0;
    }
    if (x % 2 == 0) {
      if (was1.find(x / 2) != was1.end()) {
        cout << "YES\n";
        return 0;
      }
    }
  }
  cout << "NO\n";
  return 0;
}
