#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  long long sum = 0;
  for (int i = 0; i < n; i++) sum += a[i];
  if (sum % 2) {
    cout << "NO";
    return 0;
  }
  sum /= 2;
  map<long long, int> m;
  for (int i = 0; i < n; i++) m[a[i]]++;
  long long cur = 0;
  for (int i = 0; i < n; i++) {
    if (cur == sum || m[sum - cur]) {
      cout << "YES";
      return 0;
    }
    cur += a[i];
    m[a[i]]--;
  }
  for (int i = 0; i < n; i++) m[a[i]]++;
  cur = 0;
  for (int i = n - 1; i > 0; i--) {
    if (cur == sum || m[sum - cur]) {
      cout << "YES";
      return 0;
    }
    cur += a[i];
    m[a[i]]--;
  }
  cout << "NO";
}
