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

    public class d extends PrintWriter{
        static BufferedReader s = new BufferedReader(new InputStreamReader(System.in));
        // static Scanner s=new Scanner(System.in);
        d() { super(System.out); }
        public static void main(String[] args) throws IOException{
            d d1=new d();d1.main();d1.flush();
        }void main() throws IOException {
    //        StringBuilder sb = new StringBuilder();
            PrintWriter out = new PrintWriter(System.out);
             String[] s1=s();
             int n=i(s1[0]);
            long[] a=new long[n];
            String[] s2=s();
            long sum=0;
            for(int i=0;i<n;i++) {
                a[i]=l(s2[i]);
               sum+=a[i];
            }long tsum=sum;int flag=0;
            HashMap<Long,Integer> h=new HashMap<>();
            for(int i=n-1;i>=0;i--){
                sum-=a[i];
                h.put(a[i],0);
                if(h.containsKey(tsum/2-sum)){
                    flag=1;break;
                }
            }
           h=new HashMap<>();
            sum=tsum;
            for(int i=0;i<n;i++)
            {
                sum-=a[i];
                h.put(a[i],0);
                if(h.containsKey(tsum/2-sum))
                {
                    flag=1;break;
                }
            }
            if(flag==1&&tsum%2==0){
                System.out.println("YES");
            }else{
                System.out.println("NO");
            }

        }
        static String[] s() throws IOException {

            return s.readLine().trim().split("\\s+");
        }

        static int i(String ss) {
            return Integer.parseInt(ss);
        }
        static long l(String ss) {
            return Long.parseLong(ss);
        }
    }
    class node implements Comparator<node>{
        int ver,val;
        public node(){}
        public node(int ver,int val) {
            this.ver=ver;this.val=val;
        }public int compare(node n1,node n2){
           return n1.val-n2.val;
        }
    }

    class Student12 {
        int  l;int r;
        public Student12(int l, int r) {
            this.l = l;
            this.r = r;
        }

        public String toString()
        {
            return this.l+" ";
        }
    }
    class Sortbyroll12 implements Comparator<Student12> {

        public int compare(Student12 a, Student12 b){
            return a.l-b.l;
    //        if(a.r<b.r) return 1;else if(a.r==b.r) return 0;else return -1;// a.r-b.r;
          /*  if(b.r<a.r) return -1;
            else if(b.r==a.r) return 0;
            return 1;*/

            //   return b.r-a.r;
           /*
           if(b.l<a.l) return -1;
           else if(b.l==a.l) {
               return b.r-a.r;
           }
           return 1;*/
            //        return b.r- a.r;
            //        return (int) a.l-(int) b.l;
             /*   if(a.r<b.r) return -1;
                else if(a.r==b.r){
                    if(a.r==b.r){
                        return 0;
                    }
                    if(a.r<b.r) return -1;
                    return 1;}
                return 1;  */}
    }
    class Node1 implements Comparator<Node1>{
        int node;long val;
        public  Node1(){}
        public  Node1(int node,long val){
            this.node=node;this.val=val;
        }
        @Override
        public int compare(Node1 a,Node1 b){
            if(a.val<b.val) return -1;
            if(a.val==b.val) return 0;
            {
                return 1;
            }
        }
    }
