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.awt.Point;
import java.io.*;
import java.math.BigInteger;
import java.util.*;
 
public class Main implements Runnable {
 
    int maxn = (int)1e5+111;
    int mod = (int)1e9+7;
    int inf = (int)1e9;
    int n,m,k;

    
    void solve() throws Exception {
        n = in.nextInt();
        if (n==1) {
            out.println("NO");
            return;
        }

        long a[] = new long[n+1];
        long sum = 0;
        HashMap<Long, Integer> numberCounter = new HashMap<>();
        for (int i=1; i<=n; i++) {
            a[i] = in.nextInt();
            sum+=a[i];
            numberCounter.putIfAbsent(a[i], 0);
            numberCounter.put(a[i], numberCounter.get(a[i]) + 1);
        }

        HashMap<Long, Integer> copy = (HashMap<Long, Integer>) numberCounter.clone();

        boolean leftToRight = isPossible(sum, numberCounter, a);
        reverseArray(a);
        boolean rightToLeft = isPossible(sum ,copy, a);
        if (leftToRight || rightToLeft) {
            out.println("YES");
        } else {
            out.println("NO");
        }
    }

    private void reverseArray(long[] a) {
        for (int i=1; i<=n/2; i++) {
            long t = a[i];
            a[i] = a[n+1-i];
            a[n+1-i] = t;
        }
    }

    private boolean isPossible(long sum, HashMap<Long, Integer> numberCounter, long a[]) {
        long sumLeft = 0;
        
        if (sum%2==0) {
            if (numberCounter.containsKey(sum/2)) {
                return true;
            }
        }
        
        for (int i=1; i<n-1; i++) {
            numberCounter.put(a[i], numberCounter.get(a[i])-1);
            if (numberCounter.get(a[i])<=0) numberCounter.remove(a[i]);
            sumLeft+=a[i];
            sum-=a[i];
            long dif = sum-sumLeft;
            if (dif%2==0) {
                long num = dif/2;
                if (numberCounter.containsKey(num)) {
                    return true;
                }
            }
        }

        return false;
    }

    class Pair {
    	int x;
    	int y;
    	public Pair (int x, int y) {
    		this.x = x;
    		this.y = y;
    	}
		@Override
		public int hashCode() {
			final int prime = 31;
			int result = 1;
			result = prime * result + getOuterType().hashCode();
			result = prime * result + x;
			result = prime * result + y;
			return result;
		}
		@Override
		public boolean equals(Object obj) {
			if (this == obj)
				return true;
			if (obj == null)
				return false;
			if (getClass() != obj.getClass())
				return false;
			Pair other = (Pair) obj;
			if (!getOuterType().equals(other.getOuterType()))
				return false;
			if (x != other.x)
				return false;
			if (y != other.y)
				return false;
			return true;
		}
		private Main getOuterType() {
			return Main.this;
		}
    	
    	
    }

	String fileInName = "input.txt";
    boolean file = false;
    boolean isAcmp = true;
 
    static Throwable throwable;
    public static void main (String [] args) throws Throwable {
        Thread thread = new Thread(null, new Main(), "", (1 << 26));
        thread.start();
        thread.join();
        thread.run();
        if (throwable != null)
            throw throwable;
    }
 
    FastReader in;
    PrintWriter out;
 
    public void run() {
        String fileIn = "input.txt";
        String fileOut = "output.txt";
 
        try {
            if (isAcmp) {
                if (file) {
                    in = new FastReader(new BufferedReader(new FileReader(fileIn)));
                    out = new PrintWriter (fileOut);
                } else {
                    in = new FastReader(new BufferedReader(new InputStreamReader(System.in)));
                    out = new PrintWriter(System.out);
                }
            } else if (file) {
                in = new FastReader(new BufferedReader(new FileReader(fileInName+".in")));
                out = new PrintWriter (fileInName + ".out");
            } else {
                in = new FastReader(new BufferedReader(new InputStreamReader(System.in)));
                out = new PrintWriter(System.out);
            }
 
            solve();
        } catch(Exception e) {
            throwable = e;
        } finally {
            out.close();
        }
 
    }
}
 
class FastReader {
    BufferedReader bf;
    StringTokenizer tk = null;
 
    public FastReader(BufferedReader bf) {
        this.bf = bf;
    }
 
    public String nextToken () throws Exception {
        if (tk==null || !tk.hasMoreTokens()) {
            tk = new StringTokenizer(bf.readLine());
        }
        if (!tk.hasMoreTokens()) return nextToken();
        else
            return tk.nextToken();
    }
 
    public int nextInt() throws Exception {
        return Integer.parseInt(nextToken());
    }
 
    public long nextLong() throws Exception {
        return Long.parseLong(nextToken());
    }
 
    public double nextDouble() throws Exception {
        return Double.parseDouble(nextToken());
    }
}