#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n, sum = 0, curSum;
  cin >> n;
  long long arr[n];
  map<long long, bool> mp;
  for (int i = 0; i < n; i++) cin >> arr[i], sum += arr[i];
  if (sum % 2 == 0) {
    mp[0] = 1;
    sum /= 2;
    curSum = 0;
    for (int i = 0; i < n; i++) {
      curSum += arr[i];
      mp[arr[i]] = 1;
      if (curSum >= sum)
        if (mp[curSum - sum]) return cout << "YES\n", 0;
    }
    mp.clear();
    mp[0] = 1;
    curSum = 0;
    for (int i = n - 1; i >= 0; i--) {
      curSum += arr[i];
      mp[arr[i]] = 1;
      if (curSum >= sum)
        if (mp[curSum - sum]) return cout << "YES\n", 0;
    }
  }
  cout << "NO\n";
  return 0;
}
