#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 3;
map<long long, int> r, l;
int a[N], n;
long long s[N];
int main() {
  s[0] = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    s[i] = s[i - 1] + 1LL * a[i];
    if (i > 1) r[a[i]]++;
  }
  a[0] = 0;
  a[n + 1] = 0;
  for (int i = 0; i <= n; ++i) {
    l[a[i]]++;
    long long pref = s[i], suf = s[n] - s[i];
    long long req = suf - pref;
    if (pref == suf) {
      printf("YES");
      return 0;
    }
    if (req < 0) req = -req;
    if (req % 2 != 0) continue;
    req /= 2;
    if (pref < suf) {
      if (r[req] > 0) {
        printf("YES");
        return 0;
      }
    } else {
      if (l[req] > 0) {
        printf("YES");
        return 0;
      }
    }
    r[a[i + 1]]--;
  }
  printf("NO");
  return 0;
}
