#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  long long s = 0;
  cin >> n;
  vector<int> a(n + 5, 0);
  for (int i = 0; i < n; i++) cin >> a[i], s += a[i];
  if (s & 1) {
    cout << "NO" << endl;
    return 0;
  }
  unordered_map<long long, int> first, second;
  first[a[0]] = 1;
  for (int i = 1; i < n; i++) second[a[i]]++;
  long long sdash = 0;
  for (int i = 0; i < n; i++) {
    sdash += a[i];
    if (sdash == s / 2) {
      cout << "YES" << endl;
      return 0;
    }
    if (sdash < s / 2) {
      long long x = s / 2 - sdash;
      if (second[x] > 0) {
        cout << "YES" << endl;
        return 0;
      }
    } else {
      long long y = sdash - s / 2;
      if (first[y] > 0) {
        cout << "YES" << endl;
        return 0;
      }
    }
    first[a[i + 1]]++;
    second[a[i + 1]]--;
  }
  cout << "NO" << endl;
}
