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.*;
import java.net.URI;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;

import static java.nio.file.StandardCopyOption.*;

public class Main {
    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
//        InputStream inputStream = new FileInputStream("dijkstra.in");
        OutputStream outputStream = System.out;
//        OutputStream outputStream = new FileOutputStream("dijkstra.out");


//        Path path = Paths.get(URI.create("file:///foo/bar/Main.java"));
//        System.out.print(path.getName(200));

//        Path p = Paths.get("/foo/bar/Main.java");
//        for (Path e : p) {
//            System.out.println(e);
//        }

        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Answer solver = new Answer();
        solver.solve(in, out);
        out.close();
    }
}

class Answer {
    private final int MOD = (int) (1e9 + 7);

//    private boolean find(long[] a, long x, int start, int end) {
//        for (int i = start; i <= end; i++) {
//            if (a[i] == x) {
//                return true;
//            }
//        }
//        return false;
//    }
//
//    private boolean bin(int l, int r, long[] a, long[] sum, long b) {
//        if (l > r) {
//            return false;
//        }
//
//        int m = (l + r) >> 1;
//        if (sum[m] < b) {
//            boolean fl = find(a, b - sum[m], m + 1, a.length - 1);
//            if (fl) {
//                return true;
//            }
//            return bin (m + 1, r, a, sum, b);
//        }
//        if (sum[m] > b) {
//            boolean fl = find(a, b - (sum[a.length - 1] - sum[m]), 1, m);
//            if (fl) {
//                return true;
//            }
//            if (m + 1 <= r) {
//                fl = find(a, b - (sum[a.length - 1] - sum[m + 1]), 1, m);
//                if (fl) {
//                    return true;
//                }
//            }
//
//            return  bin (l, m - 1, a, sum, b);
//        }
//        return true;
//    }

    private boolean binp(int l, int r, long[] a, long[] sum, int posa, long b) {
        if (l > r) {
            return false;
        }
        if (l == r) {
            if (l == posa) {
                return false;
            }
            if (posa > l) {
                return sum[l] == b;
            }
            return (sum[l] - a[posa]) == b;
        }

        int m = (l + r) >> 1;
        if (posa <= m) {
            if (sum[m] - a[posa] < b) {
                return binp(m + 1, r, a, sum, posa, b);
            }
            if (sum[m] - a[posa] > b) {
                return binp(l, m - 1, a, sum, posa, b);
            }
            return true;
        }

        if (posa > m) {
            if (sum[m] < b) {
                return binp(m + 1, r, a, sum, posa, b);
            }
            if (sum[m] > b) {
                return binp(l, m - 1, a, sum, posa, b);
            }
            return true;
        }

        return false;
//        return (sum[m + 1] - a[posa]) == b;
    }

    public void solve(InputReader in, PrintWriter out) throws IOException {
        int n = in.nextInt();

        long[] a = new long[n + 1];
        long[] sum = new long[n + 1];
        for (int i = 1; i <= n; i++) {
            a[i] = in.nextInt();
            sum[i] = sum[i - 1] + a[i];
        }

        if (sum[n] % 2 == 1) {
            out.print("NO");
            return;
        }
        long b = sum[n] / 2;

//        boolean fl = bin(1, n, a, sum, b);
//        if (fl) {
//            out.print("YES");
//        } else {
//            out.print("NO");
//        }

//        out.println(b);
        for (int i = 1; i <= n; i++) {
            if (sum[i] == b) {
                out.print("YES");
                return;
            }
            if (binp(1, n, a, sum, i, b)) {
                out.print("YES");
                return;
            }
            if (binp(1, n, a, sum, i, b - a[i])) {
                out.print("YES");
                return;
            }
        }
        out.print("NO");
    }
}

class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream), 32768);
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public long nextLong() {
        return Long.parseLong(next());
    }
}
