#include <bits/stdc++.h>
using namespace std;
void printa(long long int a[], int n) {
  for (int i = 0; i < n; i++) {
    cout << a[i] << " ";
  }
  cout << endl;
}
int main(int argv, char* args[]) {
  int n;
  cin >> n;
  vector<long long int> a(n);
  long long int sum = 0;
  map<int, pair<int, int> > map;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
    if (map.find(a[i]) != map.end()) {
      pair<int, int> temp = map.find(a[i])->second;
      map[a[i]] = make_pair(temp.first, i);
    } else {
      map[a[i]] = make_pair(i, i);
    }
  }
  int ans = false;
  long long int diff = sum;
  long long int temp_diff;
  for (int i = 0; i < n; i++) {
    diff -= 2 * a[i];
    if (diff > 0) {
      if (diff % 2 == 1)
        continue;
      else {
        temp_diff = diff / 2;
        if (temp_diff > INT_MAX) continue;
        if (map.find(temp_diff) != map.end()) {
          pair<int, int> temp = map.find(temp_diff)->second;
          if (i < temp.second) {
            ans = true;
            break;
          }
        }
      }
    } else if (diff < 0) {
      temp_diff = -1 * diff;
      if (temp_diff % 2 == 1)
        continue;
      else {
        temp_diff = temp_diff / 2;
        if (temp_diff > INT_MAX) continue;
        if (map.find(temp_diff) != map.end()) {
          pair<int, int> temp = map.find(temp_diff)->second;
          if (temp.first <= i) {
            ans = true;
            break;
          }
        }
      }
    } else {
      cout << "YES" << endl;
      return 0;
    }
  }
  if (ans) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}
