#include <bits/stdc++.h>
using namespace std;
pair<int, int> dir[] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
bool isValid(int i, int j, int n, int m) {
  return (i >= 0 && j >= 0 && i < n && j < m);
}
bool compare(const pair<string, long long>& lhs,
             const pair<string, long long>& rhs) {
  if (lhs.second != rhs.second) return lhs.second > rhs.second;
  return lhs.first < rhs.first;
}
struct modifedQueue {
  stack<pair<long long, long long>> s1, s2;
  void push(long long x) {
    long long newMin = s1.empty() ? x : max(x, s1.top().second);
    s1.push({x, newMin});
  }
  long long findMax() {
    long long mx;
    if (s1.empty() || s2.empty())
      mx = s1.empty() ? s2.top().second : s1.top().second;
    else
      mx = max(s1.top().second, s2.top().second);
    return mx;
  }
  void pop() {
    if (s2.empty()) {
      while (!s1.empty()) {
        pair<long long, long long> p = s1.top();
        s1.pop();
        long long newMin = s2.empty() ? p.first : max(s2.top().second, p.first);
        s2.push({p.first, newMin});
      }
    }
    s2.pop();
  }
  bool isEmpty() { return (s1.empty() && s2.empty()); }
  int size() { return (s1.size() + s2.size()); }
};
vector<vector<int>> adj;
struct customCompare {
  bool operator()(const pair<int, int>& lhs, const pair<int, int>& rhs) const {
    if (lhs.first != rhs.first)
      return lhs.first < rhs.first;
    else
      return lhs.second > rhs.second;
  }
};
const int N = 1e5 + 9;
struct record {
  string date;
  long long kilo;
  long long rate;
  bool operator<(const record& rhs) const { return date < rhs.date; }
};
int main() {
  int n;
  cin >> n;
  vector<long long> arr(n);
  for (int i = 0; i < n; i++) cin >> arr[i];
  long long sum = accumulate(arr.begin(), arr.end(), 0LL);
  set<long long> s;
  bool ans = false;
  long long sum2 = 0;
  for (int i = 0; i < n; i++) {
    sum2 += arr[i];
    s.insert(arr[i]);
    long long left = sum2;
    long long right = sum - sum2;
    if (left == right || ((left > right) && (left - right) % 2 == 0 &&
                          s.count((left - right) / 2)))
      ans = true;
  }
  sum2 = 0;
  s.clear();
  for (int i = n - 1; i >= 0; i--) {
    sum2 += arr[i];
    s.insert(arr[i]);
    long long left = sum2;
    long long right = sum - sum2;
    if (left == right || ((left > right) && (left - right) % 2 == 0 &&
                          s.count((left - right) / 2)))
      ans = true;
  }
  if (ans)
    cout << "YES\n";
  else
    cout << "NO\n";
}
