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.InputStreamReader;
import java.io.BufferedReader;
import java.io.OutputStreamWriter;
import java.io.BufferedWriter;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.*;

public class Main {
    static Reader in = null;
    static PrintWriter out = null;

    static class Point {
        long x, y;
        Point(long x, long y) {
            this.x = x;
            this.y = y;
        }
        long dist2(Point p) {
            return (this.x - p.x) * (this.x - p.x) + (this.y - p.y) * (this.y - p.y);
        }
        double dist(Point p) {
            return Math.sqrt((this.x - p.x) * (this.x - p.x) + (this.y - p.y) * (this.y - p.y));
        }
        double dist(PointReal p) {
            return Math.sqrt((this.x - p.x) * (this.x - p.x) + (this.y - p.y) * (this.y - p.y));
        }
        public String toString() {
            return "[x, y]: " + "[" + x + ", " + y + "]";
        }
    }

    static class PointReal {
        double x, y;
        PointReal(double x, double y) {
            this.x = x;
            this.y = y;
        }
        double dist(PointReal p) {
            return Math.sqrt((this.x - p.x) * (this.x - p.x) + (this.y - p.y) * (this.y - p.y));
        }
        double dist(Point p) {
            return Math.sqrt((this.x - p.x) * (this.x - p.x) + (this.y - p.y) * (this.y - p.y));
        }
        public String toString() {
            return "[x, y]: " + "[" + x + ", " + y + "]";
        }
    }

    static class Line {
        long a, b, c;
        Line(Point p1, Point p2) {
            this.a = p1.y - p2.y;
            this.b = p2.x - p1.x;
            this.c = p1.x * p2.y - p2.x * p1.y;
        }
        Line(long a, long b, long c) {
            this.a = a;
            this.b = b;
            this.c = c;
        }
        boolean isParallel(Line l) {
            return (this.a * l.b == l.a * this.b);
        }
        boolean isPerpendicular(Line l) {
            return (this.a * l.a + this.b * l.b) == 0;
        }
        PointReal intersectionWith(Line l) {
            double d = this.a * l.b - l.a * this.b;
            if(d == 0) return null;
            return new PointReal((this.b * l.c - l.b * this.c) / d, (this.c * l.a - l.c * this.a) / d);
        }
        Line getPerpendicularLineThrough(Point p) {
            return new Line(-b, a, b * p.x - a * p.y);
        }
        public String toString() {
            return "[a, b, c]: " + "[" + a + ", " + b + ", " + c + "]";
        }
    }

    static class Pair implements Comparable<Pair> {
        int x, y;
        Pair(int x, int y) {
            this.x = x;
            this.y = y;
        }
        public int compareTo(Pair p) {
            return (this.x == p.x) ? this.y - p.y : this.x - p.x;
        }
        public String toString() {
            return "[x, y]: " + "[" + x + ", " + y + "]";
        }
    }

    static void shuffle(int[] a, Random rnd) {
        for (int i = 1; i < a.length; i++) {
            int j = rnd.nextInt(i + 1);
            int t = a[i];
            a[i] = a[j];
            a[j] = t;
        }
    }

    static boolean find(long[] a, int s, int e, long key) {
        for(int i=s; i<e; i++) if(a[i] == key) return true;
        return false;
    }

    static boolean helper(long[] a, long[] sum, int n) {
        if((sum[n-1]&1) == 1) return false;
        long t = sum[n-1]/2;
        boolean flag = false;
        for(int i=0; i<n; i++) {
            if(sum[i] == t) return true;
            long y = (i == 0) ? 0 : sum[i-1];
            int s = i+1, e = n-1, x = -1;
            while(s <= e) {
                int m = (s+e)/2;
                if(y+sum[m] < t+sum[i]) s = m+1;
                else if(y+sum[m] > t+sum[i]) e = m-1;
                else return true;
            }
        }
        return false;
    }

    static void solve() throws IOException {
        int n = in.nextInt();
        long[] a = new long[n];
        long[] sum = new long[n];

        sum[0] = a[0] = in.nextInt();
        for(int i=1; i<n; i++) sum[i] = sum[i-1] + (a[i] = in.nextInt());
        boolean flag = helper(a, sum, n);

        if(!flag) {
            long[] b = new long[n];
            sum[0] = b[0] = a[n-1];
            for(int i=1; i<n; i++) sum[i] = sum[i-1] + (b[i] = a[n-i-1]);
            flag = helper(b, sum, n);
        }

        out.println(((flag) ? "YES" : "NO"));
    }

    static void test() {
//        Point p1 = new Point(1, 1);
//        Point p2 = new Point(-1, 1);
//        Po+int p = new Point(0, 0);
//        Line l1 = new Line(p1, p2);
//        Line l2 = l1.getPerpendicularLineThrough(p);
//        out.println(l1);
//        out.println(l2);
//        PointReal _p = l1.intersectionWith(l2);
//        out.println(_p);
        TreeSet<Integer> ts = new TreeSet<Integer>();
        Random r = new Random(239);
        int mx = Integer.MIN_VALUE;
        for(int i=0; i<10; i++) {
            int x = r.nextInt();
            mx = Math.max(mx, x);
            ts.add(x);
        }
        out.println(mx + " " + ts.last());
        test2(ts);
    }

    static void test2(TreeSet<Integer> ts) {
        out.println(ts.last());
    }

    public static void main(String[] args) {
        try {
            OutputStreamWriter osw = new OutputStreamWriter(System.out);
            BufferedWriter bw = new BufferedWriter(osw);
            in = new Reader();
            out = new PrintWriter(bw);

            solve();
//            test();

            out.close();
            bw.close();
            osw.close();
            in.close();
        }
        catch (IOException e) {
            e.printStackTrace();
        }
    }

    static class Reader {
        InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);
        StringTokenizer tk = new StringTokenizer("");
        String s = null;

        String nextLine() throws IOException {
            while((s = br.readLine()) != null && s.length() == 0);
            return s;
        }
        String next() throws IOException {
            if(!tk.hasMoreTokens()) tk = new StringTokenizer(nextLine());
            return tk.nextToken();
        }
        int nextInt() throws IOException {
            return Integer.parseInt(next());
        }
        long nextLong() throws IOException {
            return Long.parseLong(next());
        }
        double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }
        void close() throws  IOException {
            br.close();
            isr.close();
        }
    }
}
