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 javafx.util.Pair;

import java.io.*;
import java.util.Arrays;
import java.util.Comparator;

public class Main {
    static myScanner sc;
    static PrintWriter pw;

    public static void main(String[] args) throws IOException {
        //setInAndOutPutFromFile("ladder");
        setDefaultInAndOutPut();

        int numberOfTests = 1;
        for (int test = 1; test <= numberOfTests; test++) {
            solve();
            pw.flush();
        }

        pw.close();
    }

    static void setDefaultInAndOutPut() {
        sc = new myScanner(new BufferedReader(new InputStreamReader(System.in)));
        pw = new PrintWriter(System.out);
    }

    static void setInAndOutPutFromFile(String s) throws IOException {
        sc = new myScanner(new BufferedReader(new FileReader(new File(s + ".in"))));
        pw = new PrintWriter(new File(s + ".out"));
    }

    static void solve() {
        int n = sc.nextInt();
        Pair<Long,Integer>[] p =new Pair[n];
        for (int i = 0; i < n; i++) {
            p[i] = new Pair<>(sc.nextLong(),i);
        }

        long[] l = new long[n];
        long[] r = new long[n];
        long sum = 0;
        for (int i=0;i<n;i++)l[i]=(sum+=p[i].getKey());
        sum=0;
        for (int i=n-2;i>=0;i--)r[i]=(sum+=p[i+1].getKey());
        Arrays.sort(p, new Comparator<Pair<Long, Integer>>() {
            @Override
            public int compare(Pair<Long, Integer> o1, Pair<Long, Integer> o2) {
                int g = Long.compare(o1.getKey(),o2.getKey());
                if (g==0)return Integer.compare(o1.getValue(),o2.getValue());
                return g;
            }
        });
        for (int i=0;i<n;i++){
            if (check(i,p,l[i]-r[i])){
                pw.print("YES");
                return;
            }
        }
        pw.print("NO");
    }

    private static boolean check(int i, Pair<Long, Integer>[] p, long d) {
        if (d%2==0){
            if (d>0)return found(d/2,p,0,i);
            else if (d<0)return found(-d/2,p,i+1,p.length-1);
            else return true;
        }
        return false;
    }

    private static boolean found(long i, Pair<Long, Integer>[] p, int i1, int i2) {
        int l = 0,r = p.length;
        while (r-l>1){
            int mid=(r+l)/2;
            if (p[mid].getKey()>i)r=mid;
            else if (p[mid].getKey()<i)l=mid;
            else if (p[mid].getValue()>i2)r=mid;
            else l=mid;
        }
        return l<p.length && p[l].getKey()==i && p[l].getValue()>=i1 && p[l].getValue()<=i2;
    }
}

class myScanner {
    private char[] buffer = new char[1 << 8];
    private int pos = 1;

    private BufferedReader reader;

    public myScanner(BufferedReader reader) {
        this.reader = reader;
    }

    public boolean hasNext() {
        return pos > 0;
    }

    private void loadBuffer() {
        pos = 0;
        try {
            for (int i; (i = reader.read()) != -1; ) {
                char c = (char) i;
                if (c != ' ' && c != '\n' && c != '\t' && c != '\r' && c != '\f') {
                    if (pos == buffer.length) buffer = Arrays.copyOf(buffer, 2 * pos);
                    buffer[pos++] = c;
                } else if (pos != 0) break;
            }
        } catch (IOException e) {
            throw new UncheckedIOException(e);
        }
    }

    public String current() {
        return String.copyValueOf(buffer, 0, pos);
    }


    public String next() {
        loadBuffer();
        return current();
    }


    public String nextLine() {
        try {
            return reader.readLine();
        } catch (IOException e) {
            throw new UncheckedIOException(e);
        }
    }


    public int nextInt() {
        return nextInt(10);
    }

    public long nextLong() {
        return nextLong(10);
    }

    public int nextInt(int radix) {
        loadBuffer();
        int result = 0;
        int i = buffer[0] == '-' || buffer[0] == '+' ? 1 : 0;
        for (checkValidNumber(pos > i); i < pos; i++) {
            int digit = buffer[i] - '0';
            checkValidNumber(0 <= digit && digit <= radix - 1);
            result = result * radix + digit;
        }
        return buffer[0] == '-' ? -result : result;
    }

    public long nextLong(int radix) {
        loadBuffer();
        long result = 0;
        int i = buffer[0] == '-' || buffer[0] == '+' ? 1 : 0;
        for (checkValidNumber(pos > i); i < pos; i++) {
            int digit = buffer[i] - '0';
            checkValidNumber(0 <= digit && digit <= radix - 1);
            result = result * radix + digit;
        }
        return buffer[0] == '-' ? -result : result;
    }

    public double nextDouble() {
        loadBuffer();
        long result = 0;
        int i = buffer[0] == '-' || buffer[0] == '+' ? 1 : 0;
        long round = 1;
        final int radix = 10;
        boolean hasPoint = false;
        for (checkValidNumber(pos > i); i < pos; i++) {
            int digit = buffer[i] - '0';
            checkValidNumber((0 <= digit && digit <= radix - 1) || (!hasPoint && digit == -2));
            if (digit == -2) hasPoint = true;
            else {
                if (hasPoint) round *= radix;
                result = result * radix + digit;
            }

        }
        return buffer[0] == '-' ? -result / (1.0 * round) : result / (1.0 * round);
    }

    private void checkValidNumber(boolean condition) {
        if (!condition) throw new NumberFormatException(current());
    }
}