#include <bits/stdc++.h>
using namespace std;
const long long int N = 500023;
bool vis[N];
long long int color[N] = {0};
vector<long long int> adj[N];
set<long long int> s;
void solve() {
  long long int n;
  cin >> n;
  long long int a[n], sum = 0, sumindex = 0;
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  if (sum % 2 != 0) {
    cout << "NO";
    return;
  }
  set<long long int> s, s1;
  for (long long int i = 0; i < n; i++) {
    sumindex += a[i];
    if (sum == 2 * sumindex) {
      cout << "YES";
      return;
    }
    s.insert(a[i]);
    auto it = s.find((2 * sumindex - sum) / 2);
    if (it != s.end()) {
      cout << "YES";
      return;
    }
  }
  sumindex = 0;
  for (long long int i = n - 1; i >= 0; i--) {
    sumindex += a[i];
    if (sum == 2 * sumindex) {
      cout << "YES";
      return;
    }
    s1.insert(a[i]);
    auto it = s1.find((2 * sumindex - sum) / 2);
    if (it != s1.end()) {
      cout << "YES";
      return;
    }
  }
  cout << "NO";
}
int main() {
  long long int T;
  T = 1;
  long long int t = 0;
  while ((t++) < T) {
    solve();
    cout << endl;
  }
  return 0;
}
