#include <bits/stdc++.h>
using namespace std;
const int Mod = 1000 * 1000 * 1000 + 7;
long double a[100002];
long double t[100002];
int n;
int f(int x, long double S) {
  int L = x;
  int l = x;
  int r = n;
  while (1) {
    int m = (l + r) / 2;
    long double SS = t[m] - t[L - 1];
    if (SS == S) return 1;
    if (l == r && SS != S) return 0;
    if (SS > S) r = m;
    if (SS < S) l = m + 1;
    if (l == r && SS != S) return 0;
  }
}
int q(int x, long double S) {
  int L = x;
  int r = x;
  int l = 1;
  while (1) {
    int m = (l + r) / 2;
    long double SS = t[L] - t[m - 1];
    if (SS == S) return 1;
    if (l == r && SS != S) return 0;
    if (SS > S) l = m + 1;
    if (SS < S) r = m;
    if (l == r && SS != S) return 0;
  }
}
int main() {
  long double S = 0;
  cin >> n;
  for (int i = 1; i <= (int)n; i++) {
    cin >> a[i];
    S += a[i];
    t[i] = t[i - 1] + a[i];
  }
  long double D = 0;
  for (int i = 0; i <= (int)n - 2; i++) {
    D += a[i];
    if (D == S - D) {
      cout << "YES" << endl;
      return 0;
    }
    if (f(i + 2, (S - 2 * D) / 2) == 1) {
      cout << "YES" << endl;
      return 0;
    }
  }
  D = 0;
  for (int i = n + 1; i >= 3; i--) {
    D += a[i];
    if (D == S - D) {
      cout << "YES" << endl;
      return 0;
    }
    if (q(i - 2, (S - 2 * D) / 2) == 1) {
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
  return 0;
}
