Vasya has an array a consisting of positive integer numbers. Vasya wants to divide this array into two non-empty consecutive parts (the prefix and the suffix) so that the sum of all elements in the first part equals to the sum of elements in the second part. It is not always possible, so Vasya will move some element before dividing the array (Vasya will erase some element and insert it into an arbitrary position).

Inserting an element in the same position he was erased from is also considered moving.

Can Vasya divide the array after choosing the right element to move and its new position?

Input

The first line contains single integer n (1 ≤ n ≤ 100000) — the size of the array.

The second line contains n integers a1, a2... an (1 ≤ ai ≤ 109) — the elements of the array.

Output

Print YES if Vasya can divide the array after moving one element. Otherwise print NO.

Examples

Input

3
1 3 2


Output

YES


Input

5
1 2 3 4 5


Output

NO


Input

5
2 2 3 4 5


Output

YES

Note

In the first example Vasya can move the second element to the end of the array.

In the second example no move can make the division possible.

In the third example Vasya can move the fourth element by one position to the left.
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in Actual solution is at the top
 *
 * @author MaxHeap
 */
public class Main {

  public static void main(String[] args) {
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    InputReader in = new InputReader(inputStream);
    PrintWriter out = new PrintWriter(outputStream);
    DArrayDivision solver = new DArrayDivision();
    solver.solve(1, in, out);
    out.close();
  }

  static class DArrayDivision {

    public void solve(int testNumber, InputReader in, PrintWriter out) {
      int n = in.nextInt();
      long[] arr = in.nextLongArray(n);
      CountingMap<Long> m = new CountingMap<>();
      for (long val : arr) {
        m.increment(val);
      }

      long sum = Arr.sum(arr);

      if (sum % 2 != 0) {
        out.println("NO");
        return;
      }

      long target = sum / 2;
      long cur = 0;
      for (int i = 0; i < n; ++i) {
        cur += arr[i];
        if (cur == target) {
          out.println("YES");
          return;
        }
      }

      for (int i = 0; i < n; ++i) {
        if (arr[i] == target) {
          out.println("YES");
          return;
        }
      }
      // _ _ _ _ v
      cur = 0;
      for (int i = 0; i < n; ++i) {
        cur += arr[i];
        if (cur > target) {
          break;
        }
        m.decrement(arr[i]);
        if (m.getCount((target - cur)) > 0) {
          out.println("YES");
          return;
        }
      }

      m.clear();
      for (int i = 0; i < n; ++i) {
        m.increment(arr[i]);
      }
      cur = 0;
      for (int i = n - 1; i >= 0; --i) {
        cur += arr[i];
        if (cur > target) {
          break;
        }
        m.decrement(arr[i]);
        if (m.getCount((target - cur)) > 0) {
          out.println("YES");
          return;
        }
      }
      out.println("NO");
    }

  }

  static final class Arr {

    public static long sum(long[] arr) {
      long sum = 0;
      for (long val : arr) {
        sum += val;
      }
      return sum;
    }

  }

  static class InputReader {

    private InputStream stream;
    private static final int DEFAULT_BUFFER_SIZE = 1 << 16;
    private static final int EOF = -1;
    private byte[] buf = new byte[DEFAULT_BUFFER_SIZE];
    private int curChar;
    private int numChars;

    public InputReader(InputStream stream) {
      this.stream = stream;
    }

    public int read() {
      if (this.numChars == EOF) {
        throw new UnknownError();
      } else {
        if (this.curChar >= this.numChars) {
          this.curChar = 0;

          try {
            this.numChars = this.stream.read(this.buf);
          } catch (IOException ex) {
            throw new InputMismatchException();
          }

          if (this.numChars <= 0) {
            return EOF;
          }
        }

        return this.buf[this.curChar++];
      }
    }

    public int nextInt() {
      int c;
      for (c = this.read(); isSpaceChar(c); c = this.read()) {
      }

      byte sgn = 1;
      if (c == 45) {
        sgn = -1;
        c = this.read();
      }

      int res = 0;

      while (c >= 48 && c <= 57) {
        res *= 10;
        res += c - 48;
        c = this.read();
        if (isSpaceChar(c)) {
          return res * sgn;
        }
      }

      throw new InputMismatchException();
    }

    public long nextLong() {
      int c;
      for (c = this.read(); isSpaceChar(c); c = this.read()) {
      }

      byte sgn = 1;
      if (c == 45) {
        sgn = -1;
        c = this.read();
      }

      long res = 0;

      while (c >= 48 && c <= 57) {
        res *= 10L;
        res += c - 48;
        c = this.read();
        if (isSpaceChar(c)) {
          return res * sgn;
        }
      }
      throw new InputMismatchException();
    }

    public static boolean isSpaceChar(int c) {
      return c == 32 || c == 10 || c == 13 || c == 9 || c == EOF;
    }

    public long[] nextLongArray(int n) {
      long[] arr = new long[n];
      for (int i = 0; i < n; i++) {
        arr[i] = nextLong();
      }
      return arr;
    }

  }

  static class CountingMap<T> extends HashMap<T, Long> {

    public void increment(T key) {
      incrementBy(key, 1L);
    }

    public void decrement(T key) {
      incrementBy(key, -1L);
    }

    public void incrementBy(T key, long value) {
      put(key, getOrDefault(key, 0L) + value);
    }

    public long getCount(T key) {
      Long actualCount = get(key);
      if (actualCount == null) {
        return 0L;
      }
      return actualCount;
    }

  }
}

