#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
long long a[N], s[N] = {0}, sum = 0, aver, diff;
int main() {
  int n, flag = 0;
  set<long long> st;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", a + i);
    sum += a[i];
    s[i] = a[i] + s[i - 1];
  }
  if (sum % 2)
    printf("NO\n");
  else {
    aver = sum / 2;
    for (int i = 1; i <= n; i++) {
      st.insert(a[i]);
      if (s[i] > aver) {
        diff = s[i] - aver;
        if (st.find(diff) != st.end()) {
          flag = 1;
          break;
        }
      }
    }
    if (flag)
      printf("YES\n");
    else {
      st.clear();
      for (int i = n; i >= 1; i--) {
        st.insert(a[i]);
        sum = s[n] - s[i - 1];
        if (sum > aver) {
          diff = sum - aver;
          if (st.find(diff) != st.end()) {
            flag = 1;
            break;
          }
        }
      }
      if (flag)
        printf("YES\n");
      else
        printf("NO\n");
    }
  }
}
