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 sys
import os
from io import BytesIO, IOBase

#########################
# imgur.com/Pkt7iIf.png #
#########################



def cel(a,b): return (a+b-1)//b # find ceil(a/b) exp=> ceil(2/3)=1
def ii(): return int(input())
def mi(): return map(int, input().split())
def li(): return list(map(int, input().split()))
def lcm(a, b): return abs(a * b) // gcd(a, b)
def prr(a, sep=' '): print(sep.join(map(str, a)))
def ddi(): return defaultdict(int)
def ddl(): return defaultdict(list)
def ddd(): return defaultdict(defaultdict(int))

# region fastio

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
            while True:
                    b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
                    if not b:
                            break
                    ptr = self.buffer.tell()
                    self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
            self.newlines = 0
            return self.buffer.read()

    def readline(self):
            while self.newlines == 0:
                    b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
                    self.newlines = b.count(b"\n") + (not b)
                    ptr = self.buffer.tell()
                    self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
            self.newlines -= 1
            return self.buffer.readline()

    def flush(self):
            if self.writable:
                    os.write(self._fd, self.buffer.getvalue())
                    self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
            self.buffer = FastIO(file)
            self.flush = self.buffer.flush
            self.writable = self.buffer.writable
            self.write = lambda s: self.buffer.write(s.encode("ascii"))
            self.read = lambda: self.buffer.read().decode("ascii")
            self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

from collections import defaultdict 
# from collections import deque
#from collections import OrderedDict
from math import gcd,pi,inf
#import time
#import itertools
#import timeit
# import random
from bisect import bisect_left as bl
# from bisect import bisect_right as br
#from bisect import insort_left as il
#from bisect import insort_right as ir
from heapq import *
# from queue import PriorityQueue
#mod=998244353
#mod=10**9+7


def is_present(a,v):
        idx=bl(a,v)
        return idx<len(a) and a[idx]==v

def solve():
        n=ii()
        a=li()
        d=ddl()
        sorted_list=list(set(a))
        sorted_list.sort()
        a=[0]+a+[0]
        n=len(a)
        pref=[0 for i in range(n)]
        suff=[0 for i in range(n)]
        for i in range(n):
                pref[i]=(pref[i-1] if i else 0)+a[i]
                if a[i] not in d:
                        d[a[i]].extend([i,-1])
        for i in range(n-1,-1,-1):
                suff[i]=(suff[i+1] if i<n-1 else 0)+a[i]
                if d[a[i]][1]==-1:
                        d[a[i]][1]=i

        # print(d)
        for i in range(1,n):
                p_sum,s_sum=pref[i-1],suff[i]
                if p_sum==s_sum:
                        print('YES')
                        return
                to_find=[]
                if p_sum>s_sum:
                        tmp=(p_sum-s_sum)
                        if not tmp&1:
                                to_find=[tmp//2]
                        for v in to_find:
                                if is_present(sorted_list,v):
                                        l,r=d[v]
                                        if l<=i-1:
                                                print('YES')
                                                return

                else:
                        tmp=(s_sum-p_sum)
                        if not tmp&1:
                                to_find=[tmp//2]
                        for v in to_find:
                                if is_present(sorted_list,v):
                                        l,r=d[v]
                                        if r>=i:
                                                print('YES')
                                                return

        print('NO')
        return



solve()










