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.*;

public class A implements Runnable {
	public static void main (String[] args) {new Thread(null, new A(), "_cf", 1 << 28).start();}
	
	public void run() {
		FastScanner fs = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		System.err.println("");

		int n = fs.nextInt();
		int[] a = fs.nextIntArray(n);
		long sum = 0;
		for(int i : a) sum += i;
		
		long left = 0, right = sum;
		for(int i = 0; i < n-1; i++) {
			right -= a[i];
			left += a[i];
			if(left == right) {
				System.out.println("YES");
				return;
			}
		}
		
		HashMap<Integer, Integer> mapLeft = new HashMap<>();
		HashMap<Integer, Integer> mapRight = new HashMap<>();
		int leftSize = 0, rightSize = n;
		
		for(int i = 0; i < n; i++) add(mapRight, a[i]);
		left = 0; right = sum;
		
		for(int i = 0; i < n; i++) {
			rem(mapRight, a[i]);
			add(mapLeft, a[i]);
			left += a[i];
			right -= a[i];
			leftSize++; rightSize--;
			
			if(right > left) {
				long diff = right-left;
				if(diff % 2 == 0 && diff/2 <= (int)1e9 && mapRight.containsKey((int)diff/2) && rightSize > 1) {
					System.out.println("YES");
					return;
				}
			}
			else {
				long diff = left-right;
				if(diff % 2 == 0 && diff/2 <= (int)1e9 && mapLeft.containsKey((int)diff/2) && leftSize > 1) {
//					System.out.println(i + " " + diff);
					System.out.println("YES");
					return;
				}
			}
		}
		
		System.out.println("NO");
		
		out.close();
	}
	
	void add(HashMap<Integer, Integer> map, int x) {
		if(!map.containsKey(x)) map.put(x, 0);
		map.put(x, map.get(x)+1);
	}
	void rem(HashMap<Integer, Integer> map, int x) {
		int fr = map.get(x)-1;
		if(fr == 0) map.remove(x);
		else map.put(x, fr);
	}
	
	
	class FastScanner {
		public int BS = 1<<16;
		public char NC = (char)0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;

		public FastScanner() {
			in = new BufferedInputStream(System.in, BS);
		}

		public FastScanner(String s) {
			try {
				in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
			}
			catch (Exception e) {
				in = new BufferedInputStream(System.in, BS);
			}
		}

		public char nextChar(){
			while(bId==size) {
				try {
					size = in.read(buf);
				}catch(Exception e) {
					return NC;
				}                
				if(size==-1)return NC;
				bId=0;
			}
			return (char)buf[bId++];
		}

		public int nextInt() {
			return (int)nextLong();
		}

		public long nextLong() {
			num=1;
			boolean neg = false;
			if(c==NC)c=nextChar();
			for(;(c<'0' || c>'9'); c = nextChar()) {
				if(c=='-')neg=true;
			}
			long res = 0;
			for(; c>='0' && c <='9'; c=nextChar()) {
				res = (res<<3)+(res<<1)+c-'0';
				num*=10;
			}
			return neg?-res:res;
		}

		public double nextDouble() {
			double cur = nextLong();
			return c!='.' ? cur:cur+nextLong()/num;
		}

		public String next() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c>32) {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public String nextLine() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c!='\n') {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public boolean hasNext() {
			if(c>32)return true;
			while(true) {
				c=nextChar();
				if(c==NC)return false;
				else if(c>32)return true;
			}
		}
		
		public int[] nextIntArray(int n) {
			int[] res = new int[n];
			for(int i = 0; i < n; i++) res[i] = nextInt();
			return res;
		}
		
	}

}