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.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.math.*;


public class Main
{
	//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	static class Solution
	{
		static final long mod = 1000000007;
		static final int  max = 1000003;
		static final boolean SIEVE = false;
		boolean[] prime;
        ArrayList<Integer> al;
		////////////////////////////
		long n,k,m;
	    public void solve() 
	    {
	       int n = i();
		  // out.println("n");
		   long[] ar = new long[n];
		   long[] br = new long[n];
		   long sum=0;
		  // out.println("n");
		   for(int i=0;i<n;i++){	
				ar[i] = l(); 
				sum+=ar[i]; 
				br[n-i-1]=ar[i];
		   }
		  
		   if((sum&1)==1)
		   {
			   out.println("NO");
			   out.flush();
			   System.exit(0);
		   }
		   sum_nikalo(ar,sum);
		   sum_nikalo(br,sum);
		   out.println("NO"); 
		   
    	}
		void sum_nikalo(long[] ar,long sum){
			HashMap<Long,Integer> mp = new HashMap<Long,Integer>();
			long tot=0;
			//out.println("j");
			for(int i=0;i<ar.length;i++)
			{
				mp.put(ar[i],1);
				tot+=ar[i];
				long u = tot-sum/2;
				//out.println(u);
				if(mp.containsKey(u)&&mp.get(u)==1)
				{
					out.println("YES");
					out.flush();
					System.exit(0);
				}
			}
		}
		int lower_bound(long[] a, long x,int l,int h) {
    	   // Not n - 1
		    if(h<l) return -1;
    		while (l < h) {
        		int mid = (l + h) / 2;
        		if (x <= a[mid]) {
            		h = mid;
        		} else {
            		l = mid + 1;
        		}
    		}
			if(a[l]!=x)
				return -1;
    		return l;
		}
		
    	
    	///////////////////////////////Methods///////////////////////////////////////////////////////
      
        ///////////////////////////////////////Methods/////////////////////////////////////////////////////
 	
	//////////////////////////////////////////shortcuts///////////////////////////////////////////////	
		public int i(){	return sc.nextInt();}
		public long l(){ return sc.nextLong();}
		public String s(){ return sc.next();}
		public int[] iarr(int n){int[] ar = new int[n];for(int i=0;i<n;i++) ar[i] = sc.nextInt(); return ar; }
		public void parr(int[] ar){	for(int i=0;i<ar.length;i++)	out.print(ar[i]+" ");
			out.println();
		}
		public void parr(long[] ar){	for(int i=0;i<ar.length;i++)	out.print(ar[i]+" ");
			out.println();
		}
 	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	}
	static InputReader sc = new InputReader();
	static PrintWriter out= new PrintWriter(System.out);
	Main() throws IOException {
	   	
	    
	    final long start = System.currentTimeMillis();		
		new Solution().solve();
		@SuppressWarnings("unused")
		final long duration = System.currentTimeMillis()-start;
		
		out.close();
	}
 
	public static void main(String args[]) {
		new Thread(null, new Runnable() {
			public void run() {
				try {
					new Main();
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		}, "1", 1 << 26).start();
	}
	static class InputReader{
		final InputStream stream;
		final byte[] buf = new byte[8192];
		int curChar, numChars;
		SpaceCharFilter filter;
 
		public InputReader(){
			this.stream = System.in;
		}
 
		public int read(){
			if(numChars == -1){
				throw new InputMismatchException();
			}
			if(curChar >= numChars){
				curChar = 0;
				try{
					numChars = stream.read(buf);
				} catch(IOException e){
					throw new InputMismatchException();
				}
				if(numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}
 
		public int nextInt(){
			int c = read();
			while(isSpaceChar(c))
				c = read();
			int sgn = 1;
			if(c == '-'){
				sgn = -1;
				c = read();
			}
			int res = 0;
			do{
				if(c<'0' || c>'9'){
					throw new InputMismatchException();}
				res *= 10;
				res += c - '0';
				c = read();
			} while(!isSpaceChar(c));
			return res*sgn;
		}
 
		public long nextLong(){
			int c = read();
			while(isSpaceChar(c))
				c = read();
			int sgn = 1;
			if(c == '-'){
				sgn = -1;
				c = read();
			}
			long res = 0;
			do{
				if(c<'0' || c>'9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while(!isSpaceChar(c));
			return res*sgn;
		}
 
		public String next(){
			int c = read();
			while(isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do{
				res.appendCodePoint(c);
				c = read();
			}while(!isSpaceChar(c));
			return res.toString();
		}
 
		public boolean isSpaceChar(int c){
			if(filter != null)
				return filter.isSpaceChar(c);
			return c==' ' || c=='\n' || c=='\r' || c=='\t' || c==-1;
		}
 
		public interface SpaceCharFilter{
			public boolean isSpaceChar(int ch);
		}
	}

}