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.

    //package cf;
    import java.io.*;
    import java.util.*;
    import java.util.jar.JarOutputStream;

    public class Temp_Class {
        static int p=1000000007;

        public static void main(String[] args) throws Exception{
            BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(java.io.FileDescriptor.out), "ASCII"), 512);
            FastReader sc=new FastReader();
            int t=1;
            StringBuilder sb=new StringBuilder();
            while(t-- >0)
            {
                int n=sc.nextInt();
                HashMap<Long,TreeSet<Integer>> h1=new HashMap<>();
                Long ar[]=new Long[n];
                Long pr[]=new Long[n];
                Arrays.fill(pr,0l);
                for(int i=0;i<n;i++)
                {
                    ar[i]=sc.nextLong();
                    if(h1.containsKey(ar[i]))
                    {
                        TreeSet<Integer> ind=h1.get(ar[i]);
                        ind.add(i);
                        h1.put(ar[i],ind);
                    }
                    else
                    {
                        TreeSet<Integer> ind=new TreeSet<>();
                        ind.add(i);
                        h1.put(ar[i],ind);
                    }
                    if(i!=0)
                    {
                        pr[i]=ar[i];
                        pr[i]+=pr[i-1];
                    }
                    else
                        pr[i]=ar[i];
                }
                if(pr[n-1]%2!=0)
                {
                    sb.append("NO\n");
                }
                else {
                    long mid=pr[n-1]/2;
                    int p=Arrays.binarySearch(pr,mid);
                 //   System.out.println(mid+" mid "+p);
                    for(int i=binary_Search_upper(pr,mid);i<n&&p<0;i++)
                    {
                        if(pr[i]>mid)
                        {
                           // Long tar[]=Arrays.copyOf(ar,i+1);
                           // Arrays.sort(tar);
                      //      System.out.println(Arrays.toString(tar)+" "+pr[i]+" - " +(pr[n-1]-pr[i]));
                            long sum=pr[i]-(pr[n-1]-pr[i]);
                            sum/=2;
                                /*Arrays.sort(tar);*/
                            if(h1.containsKey(sum)) {
                                Integer ind = h1.get(sum).floor(i - 1);
                               // System.out.println(ind+" "+h1.get(sum));
                                if (ind != null)
                                    p = ind;
                            }
                        //    System.out.println(sum+" "+p);
                        }
                    }
                    if(p<0)
                    {
                        for(int i=0;i<n/2;i++)
                        {
                            Long tempp=ar[i];
                            ar[i]=ar[n-1-i];
                            ar[n-1-i]=tempp;
                        }
                        h1.clear();
                        for(int i=0;i<n;i++)
                        {
                            if(h1.containsKey(ar[i]))
                            {
                                TreeSet<Integer> ind=h1.get(ar[i]);
                                ind.add(i);
                                h1.put(ar[i],ind);
                            }
                            else
                            {
                                TreeSet<Integer> ind=new TreeSet<>();
                                ind.add(i);
                                h1.put(ar[i],ind);
                            }
                            pr[i]=ar[i];
                            if(i==0)
                                continue;
                            pr[i]+=pr[i-1];
                        }

                         p=Arrays.binarySearch(pr,mid);
                        for(int i=binary_Search_upper(pr,mid);i<n&&p<0;i++)
                        {
                            if(pr[i]>mid)
                            {
                                // Long tar[]=Arrays.copyOf(ar,i+1);
                                // Arrays.sort(tar);
                                //      System.out.println(Arrays.toString(tar)+" "+pr[i]+" - " +(pr[n-1]-pr[i]));
                                long sum=pr[i]-(pr[n-1]-pr[i]);
                                sum/=2;
                                /*Arrays.sort(tar);*/
                                if(h1.containsKey(sum)) {
                                    Integer ind = h1.get(sum).floor(i - 1);
                                    // System.out.println(ind+" "+h1.get(sum));
                                    if (ind != null)
                                        p = ind;
                                }
                                //    System.out.println(sum+" "+p);
                            }
                        }
                        if(p<0)
                        sb.append("NO\n");
                        else
                            sb.append("YES\n");
                    }
                    else
                        sb.append("YES\n");
                }
             //   System.out.println(Arrays.toString(apl));
               }
            //bwbwwbwbw*bwbwwbwbw
            System.out.println(sb.toString());
            out.flush();
        }


        public static boolean union(int a, int b, int p[], int r[]){
            // add your code here
            int pa=find(a,p,r);
            int pb=find(b,p,r);
            if(pa==pb)
                return true;
            if(pa!=pb)
            {
                if(r[pa]<r[pb])
                {
                    p[pa]=pb;
                }
                else if(r[pa]>r[pb])
                {
                    p[pb]=pa;
                }
                else
                {
                    p[pa]=pb;
                    r[pb]++;
                }
            }
            return false;
        }
        public static int find(int x,int p[],int r[])
        {
            if(p[x]==x)
                return x;
            p[x]=find(p[x],p,r);
            return p[x];
        }
        public static int binary_Search_upper(Long ar[],Long x)
        {
            int res=-1;
            int l=0;int r=ar.length-1;
            while(l<=r)
            {
                int mid=(l+r)>>1;
                if(ar[mid]==x)
                {
                    res=mid;
                    l=mid+1;
                }
                else if(ar[mid]>x)
                {
                    res=mid;
                    r=mid-1;
                }
                else
                {
                    l=mid+1;
                }
            }
            return res;
        }
        public static int binary_Search_lower(int ar[],int x)
        {
            int res=-1;
            int l=0;int r=ar.length-1;
            while(l<=r)
            {
                int mid=(l+r)>>1;
                if(ar[mid]==x)
                {
                    res=mid;
                    r=mid-1;
                }
                else if(ar[mid]>x)
                {
                    r=mid-1;
                }
                else
                {
                    res=mid;
                    l=mid+1;
                }
            }
            return res;
        }
        int bit[]=new int[(int)1e6];
        public void update(int n,int val,int i)
        {
            i++;
            while(i<n)
            {
                bit[i]+=val;
                i+=(i)&(-i);
            }

        }
        public long query(int n,int i)
        {
            i++;
            long sum=0;
            while(i>0)
            {
                sum+=bit[i];
                i-=(i)&(-i);
            }
            return sum;
        }


        ///////////////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////////////////
        static class FastReader {

            BufferedReader br;
            StringTokenizer st;

            public FastReader() {
                br = new BufferedReader(new InputStreamReader(System.in));
            }

            String next() {
                while (st == null || !st.hasMoreElements()) {
                    try {
                        st = new StringTokenizer(br.readLine());
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
                return st.nextToken();
            }

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

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

            double nextDouble() {
                return Double.parseDouble(next());
            }

            String nextLine() {
                String str = "";
                try {
                    str = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                return str;
            }
        }


    }
