#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n;
  cin >> n;
  long long s = 0;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    s += a[i];
  }
  if (s % 2) {
    cout << "NO";
    return 0;
  }
  set<long long> st;
  long long just = 0;
  for (long long i = 0; i < n; i++) {
    just += a[i];
    if (just == s - just) {
      cout << "YES";
      return 0;
    }
    if (st.find((2 * just - s) / 2) != st.end()) {
      cout << "YES";
      return 0;
    }
    st.insert(a[i]);
  }
  st.clear();
  just = 0;
  reverse(a, a + n);
  for (long long i = 0; i < n; i++) {
    just += a[i];
    if (just == s - just) {
      cout << "YES";
      return 0;
    }
    if (st.find((2 * just - s) / 2) != st.end()) {
      cout << "YES";
      return 0;
    }
    st.insert(a[i]);
  }
  cout << "NO";
  return 0;
}
