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.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.util.List;
 import java.util.*;
public  class realfast implements Runnable 
  {
    private static final int INF = (int) 1e9;
    long in= (long)Math.pow(10,9)+7;
    long fac[]= new long[3000];
    public  void solve() throws IOException 
    {
        int n = readInt();
        int arr[]= new int[n];
        for(int i=0;i<n;i++)
            arr[i]= readInt();
         long cur =0;
        long sum[]= new long[n];
        for(int i =0;i<n;i++)
        {
            cur=cur+arr[i];
            sum[i]=cur;
        }
        boolean check=false;
        for(int i=0;i<n;i++)
        {
            long val = arr[i];
            int left =0;
            int right =n-1;
            long find = (sum[n-1]/2)- arr[i];
            //out.println(find);
            while(left<=right)
            {
                int mid = left+(right-left)/2;
                long stole=sum[mid];
                 if(mid>=i)
                 {
                   stole=stole-val;
                 }
                 if(stole==find)
                 {
                    check=true;
                    break;
                 }
                 if(stole>find)
                 {
                    right=mid-1;
                 }
                 else
                 {
                    left=mid+1;
                 }
            }
            if(check)
                break;

             val = arr[i];
             left =0;
             right =n-1;
             find = (sum[n-1]/2);
            //out.println(find);
            while(left<=right)
            {
                int mid = left+(right-left)/2;
                long stole=sum[mid];
                 if(mid>=i)
                 {
                   stole=stole-val;
                 }
                 if(stole==find)
                 {
                    check=true;
                    break;
                 }
                 if(stole>find)
                 {
                    right=mid-1;
                 }
                 else
                 {
                    left=mid+1;
                 }
            }
            if(check)
                break;
        }
        if(((sum[n-1]%2)==0)&&check)
            out.println("YES");
        else
            out.println("NO");

    }
    public int seg(int seg[], int left, int right, int index, int val)
    {
        if(left==right)
        {
            seg[index]=1;
            return 1;
        }
        int mid = left+(right-left)/2;

        if(val<=mid)
        {
            seg(seg,left,mid,2*index+1,val);
        }
        else
        {
            seg(seg,mid+1,right,2*index+2,val);
        }
        seg[index]= seg[2*index+1]+seg[2*index+2];
        return seg[index];
    }
    public int val(int seg[], int left , int right, int l , int r,int index)
    {
            if(left>r||right<l)
            {
               return 0;
            }
            int mid = left+(right-left)/2;
            if(left>=l&&right<=r)
            return seg[index];

            return val(seg,left,mid,l,r,2*index+1)+val(seg,mid+1,right,l,r,2*index+2);
    }
    public int gcd(int a , int b )
    {
      if(a<b)
      {
        int t =a;
        a=b;
        b=t;
      }
      if(a%b==0)
        return b ;
      return gcd(b,a%b);
    }
    public long pow(long n , long p,long m)
    {
         if(p==0)
            return 1;
        long val = pow(n,p/2,m);;
        val= (val*val)%m;
        if(p%2==0)
            return val;
        else
            return (val*n)%m;
    }
    
    
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    public static void main(String[] args) {
        new Thread(null, new realfast(), "", 128 * (1L << 20)).start();
    }
 
    private static final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
    private BufferedReader reader;
    private StringTokenizer tokenizer;
    private PrintWriter out;
 
    @Override
    public void run() {
        try {
            if (ONLINE_JUDGE || !new File("input.txt").exists()) {
                reader = new BufferedReader(new InputStreamReader(System.in));
                out = new PrintWriter(System.out);
            } else {
                reader = new BufferedReader(new FileReader("input.txt"));
                out = new PrintWriter("output.txt");
            }
            solve();
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            try {
                reader.close();
            } catch (IOException e) {
                // nothing
            }
            out.close();
        }
    }
 
    private String readString() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }
 
    @SuppressWarnings("unused")
    private int readInt() throws IOException {
        return Integer.parseInt(readString());
    }
 
    @SuppressWarnings("unused")
    private long readLong() throws IOException {
        return Long.parseLong(readString());
    }
 
    @SuppressWarnings("unused")
    private double readDouble() throws IOException {
        return Double.parseDouble(readString());
    }
}
class edge implements Comparable<edge>{
    int val ;
    int color;
    
    edge(int u, int v)
    {
       this.val=u;
       this.color=v;
    }
    public int compareTo(edge e)
    {
        return this.val-e.val;
    }
}