#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 100 * 1000 + 13;
long long a[MAXN], sum[MAXN];
set<long long> nums;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long n;
  cin >> n;
  if (n == 1) {
    cout << "NO" << endl;
    return 0;
  }
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    sum[i] = sum[i - 1] + a[i];
  }
  if (sum[n] & 1) {
    cout << "NO" << endl;
    return 0;
  }
  nums.insert(a[n]);
  for (long long i = n - 1; i >= 1; i--) {
    if (sum[i] == (sum[n] / 2)) {
      cout << "YES" << endl;
      return 0;
    }
    long long diff = 2 * sum[i] - sum[n];
    diff /= 2;
    if (nums.find(a[i] - diff) != nums.end()) {
      cout << "YES" << endl;
      return 0;
    }
    nums.insert(a[i]);
  }
  nums.clear();
  nums.insert(a[1]);
  for (long long i = 2; i <= n; i++) {
    long long diff = -(2 * sum[i - 1] - sum[n]);
    diff /= 2;
    if (nums.find(a[i] - diff) != nums.end()) {
      cout << "YES" << endl;
      return 0;
    }
    nums.insert(a[i]);
  }
  cout << "NO" << endl;
  return 0;
}
