#include <bits/stdc++.h>
using namespace std;
const int maxLL = numeric_limits<int>::max();
const long long MOD = 1e9 + 7;
long long n;
vector<long long> a;
int main() {
  cin >> n;
  a = vector<long long>(n + 5);
  long long s = 0;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    s += a[i];
  }
  set<long long> appear;
  long long left = 0;
  for (long long i = 0; i < n; i++) {
    left += a[i];
    if (s - left == left) {
      cout << "YES";
      return 0;
    }
    appear.insert(a[i]);
    long long diff = left - (s - left);
    if (diff % 2 == 0 && appear.find(diff / 2) != appear.end()) {
      cout << "YES";
      return 0;
    }
  }
  appear.clear();
  left = 0;
  for (long long i = 0; i < n; i++) {
    left += a[n - i - 1];
    if (s - left == left) {
      cout << "YES";
      return 0;
    }
    appear.insert(a[n - i - 1]);
    long long diff = left - (s - left);
    if (diff % 2 == 0 && appear.find(diff / 2) != appear.end()) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
