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.util.*;
import java.io.*;


   



    public class Sample implements Runnable{
    static ArrayList<Integer>[] al;
         static class Pair implements Comparator<Pair>{
  int a;
  int b;
  Pair(){

  }
  Pair(int a,int b){
    this.a=a;
    this.b=b;
  }
  public int compare(Pair p1,Pair p2){

    return p2.b-p1.b;
 }
}
  static class Beauty implements Comparator<Beauty>{
    int beauty;
    int cost;
    Beauty(){
        }
    Beauty(int beauty,int cost){
      this.beauty=beauty;
      this.cost=cost;

    }
    public int compare(Beauty b1,Beauty b2 ){
      if(b2.beauty-b1.beauty==0){
        return b1.cost-b2.cost;
      }else{
        return b2.beauty-b1.beauty;
      }
    }

  }

  
   static InputReader sc = new InputReader(); 
   static int gcd(int a,int b){
    if(a==0){
      return b;
    }
    return gcd(b%a,a);
   }
   static int d;
   static int[] color;
   static boolean[] v;
  /*  static void dfs(int src,int x,int y){
      v[src]=true;
     int  i=1;
     color[src]=x;
      for(int a :al[src]){
        if(v[a]) continue;
        if(i==x|| i==y){
          i++;
          if(i==x|| i==y){
          i++;
        }
        }
        color[a]=i;
        i++;
         
      }
      for(int a:al[src]){
        if(!v[a]){
          dfs(a,color[a],x);
        }
      }




    }*/
    static long[] a;
    static long[] b;
    public static boolean possible(double mid,int n){
      double l=a[1]-b[1]*mid;
      double r=a[1]+b[1]*mid;
      for(int i=2;i<=n;i++){
        l=Math.max(l,a[i]-b[i]*mid);
        r=Math.min(r,a[i]+b[i]*mid);

      }
      if(l>r)return false;
      else  return true;
    }

public static boolean isvowel(char ch){
    if(ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u'){
        return true;
    }else{
        return false;
    }
}
static long[] fac;
 static long[] inv;
 static long mod=(long)1e9+7;
static int[] prime;
static Integer[] ans;
 
static ArrayList<Integer>[] al1;
static ArrayList<Integer>[] al2;
static int[] lol1;
static int[] lol2;
static boolean[] v1;
static boolean[] v2;
 
 

     public static void main(String args[]) throws IOException
    { 
         new Thread(null, new Sample(), "whatever", 1<<26).start();
      
    }




 

  
    public void run(){
             int n=i();
             int[] a=new int[n+1];
             long[] samne_se_sum=new long[n+1];
             long[] piche_se_sum=new long[n+1];
             boolean mil_gya_aadha=false;
             for (int i=1;i<=n ;i++ ) {
               a[i]+=i();
               samne_se_sum[i]=samne_se_sum[i-1]+a[i];


             }
             for (int i=n-1;i>=1 ;i-- ) {
               piche_se_sum[i]=piche_se_sum[i+1]+a[i];
               if(piche_se_sum[i]/2==samne_se_sum[n]){mil_gya_aadha=true;}
             }
             if(samne_se_sum[n]%2!=0){
                  mil_gya_aadha=false;
                System.out.println("NO");
                return;
             }
             for (int i=1;i<=n ;i++ ) {
              //System.out.println(samne_se_sum[i]);
               mil_gya_aadha |=binarySearch(samne_se_sum,1,i-1,samne_se_sum[n]/2-a[i]);
              // System.out.println(""+mil_gya_aadha);
               mil_gya_aadha |=binarySearch(samne_se_sum,i+1,n,samne_se_sum[n]/2+a[i]);
             }
             for (int i=1;i<=n ;i++ ) {
              // mil_gya_aadha |=binarySearch(piche_se_sum,1,i,samne_se_sum[n]/2-a[i]);
             }
             if(mil_gya_aadha==true){
                System.out.println("YES");
             }else{
                System.out.println("NO");
             }

            
       }
       public static boolean binarySearch(long[] a,int low,int high,long key){

        if(low>high){
          return false;
        }else{
          int mid=(low+high)/2;
          if(a[mid]==key){
            return true;
          }else if(a[mid]<key){
            return binarySearch(a,mid+1,high,key);
          }
          else{
            return binarySearch(a,low,mid-1,key);
          }
        }




       }
                

















    
    /////////////////////////////////////////////////////////// shortcuts //////////////////////////////
      public static long modPow(long base, long exp, long mod) {
        base = base % mod;
        long result = 1;
        while (exp > 0) {
            if (exp % 2 == 1) {
                result = (result * base) % mod;
                exp--;
            } else {
                base = (base * base) % mod;
                exp = exp >> 1;
            }
 
        }
        return result;
    }
 
 
    public static void cal() {
        fac = new long[1000005];
        inv = new long[1000005];
        fac[0] = 1;
        inv[0] = 1;
        for (int i = 1; i <= 1000000; i++) {
            fac[i] = (fac[i - 1] * i) % mod;
            inv[i] = (inv[i - 1] * modPow(i, mod - 2, mod)) % mod;
        }
    }
 
   /* public static long ncr(int n, int r) {
        return (((fac[n] * inv[r]) % mod) * inv[n - r]) % mod;
    }
 */

      static int i() {
           
          return sc.nextInt();
        }
        static long l(){
          return sc.nextLong();

        }
        static double d() throws IOException{
          return sc.nextDouble();
        }
        static String s(){
          return sc.next();

        }
        static String sL() throws IOException{
          return sc.nextLine();
        }
       static void loop(int[] a) throws IOException{
          for(int j=0;j<a.length;j++){
              a[j]=i();
          }
        }
        static void eloop(int[] a) throws IOException{
          for(int i=1;i<=a.length;i++){
              a[i]=i();
          }
        }
        static void ploop(int[] a)throws IOException{
             for(int j=0;j<a.length;j++){
                System.out.println(a[j]);
             }

        }
        static void eploop(int[] a)throws IOException{
             for(int j=1;j<=a.length;j++){
                System.out.println(a[j]);
             }

        } 
  
        ////////////////////////////////////////////////////////////////////////////////////////////////////
     

   

  static class InputReader {
        BufferedReader br;
        StringTokenizer st;
 
        public InputReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }
 
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }
 
        int nextInt() {
            return Integer.parseInt(next());
        }
 
        long nextLong() {
            return Long.parseLong(next());
        }
 
        double nextDouble() {
            return Double.parseDouble(next());
        }
 
        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            }
            catch (IOException e) {
                throw new RuntimeException();
            }
            return str;
        }
    }

 }