Mahmoud has n line segments, the i-th of them has length ai. Ehab challenged him to use exactly 3 line segments to form a non-degenerate triangle. Mahmoud doesn't accept challenges unless he is sure he can win, so he asked you to tell him if he should accept the challenge. Given the lengths of the line segments, check if he can choose exactly 3 of them to form a non-degenerate triangle.

Mahmoud should use exactly 3 line segments, he can't concatenate two line segments or change any length. A non-degenerate triangle is a triangle with positive area.

Input

The first line contains single integer n (3 ≤ n ≤ 105) — the number of line segments Mahmoud has.

The second line contains n integers a1, a2, ..., an (1 ≤ ai ≤ 109) — the lengths of line segments Mahmoud has.

Output

In the only line print "YES" if he can choose exactly three line segments and form a non-degenerate triangle with them, and "NO" otherwise.

Examples

Input

5
1 5 3 2 4


Output

YES


Input

3
4 1 2


Output

NO

Note

For the first example, he can use line segments with lengths 2, 4 and 5 to form a non-degenerate triangle.
//package credit;
import java.awt.*;
import java.io.*;
import java.lang.management.ClassLoadingMXBean;
import java.sql.SQLIntegrityConstraintViolationException;
import java.util.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.util.StringTokenizer;
public class sas {
    static boolean v[];
    static int ans[];
    int size[];
    static int count=0;
    static int dsu=0;
    static int c=0;
    double min=Double.POSITIVE_INFINITY;
    int max=Integer.MIN_VALUE;
    boolean aBoolean=true;
    PrintWriter printWriter = new PrintWriter(System.out);
        static class FastReader
        {
            BufferedReader br;
            StringTokenizer st;

            public FastReader()
            {
                br = new BufferedReader(new
                        InputStreamReader(System.in));
            }

            String next()
            {
                while (st == null || !st.hasMoreElements())
                {
                    try
                    {
                        st = new StringTokenizer(br.readLine());
                    }
                    catch (IOException  e)
                    {
                        e.printStackTrace();
                    }
                }
                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)
                {
                    e.printStackTrace();
                }
                return str;
            }
        }
        int parent[];
        int rank[];
        public static void main(String[] args) throws IOException {
            sas g = new sas();
            g.go();
        }
        public void go() throws IOException {
//            FastReader scanner=new FastReader();
            Scanner scanner=new Scanner(System.in);
            int t =1;
            for (int i = 0; i < t; i++) {
                int n = scanner.nextInt();
                long arr[]=new long[n];
                boolean t1=true;
                for (int j = 0; j <n ; j++) {
                    arr[j]=scanner.nextInt();
                }
                sort(arr,n);
                for (int j = 1; j <n-1 ; j++) {
                    if(arr[j-1]+arr[j]>arr[j+1]){
                        printWriter.println("YES");
                        t1=false;
                        break;
                    }
                }
                if(t1){
                    printWriter.println("NO");
                }
            }
            printWriter.flush();
        }
        public void parent(int n){
            for (int i = 0; i < n; i++) {
                parent[i]=i;
                rank[i]=1;
                size[i]=1;
            }
        }
        public void union(int i,int j){
            int root1=find(i);
            int root2=find(j);
//            if(root1 != root2) {
//                parent[root2] = root1;
////                sz[a] += sz[b];
//            }
            if(root1==root2){
                return;
            }
            if(rank[root1]>rank[root2]){
                parent[root2]=root1;
                size[root1]+=size[root2];
            }
            else if(rank[root1]<rank[root2]){
                parent[root1]=root2;
                size[root2]+=size[root1];
            }
            else{
                parent[root2]=root1;
                rank[root1]+=1;
                size[root1]+=size[root2];
            }
        }
        public int find(int p){
           if(parent[p]!=p){
               parent[p]=find(parent[p]);
           }
           return parent[p];
//            if(parent[p]==-1){
//                return -1;
//            }
//            else if(parent[p]==p){
//                return p;
//            }
//            else {
//                parent[p]=find(parent[p]);
//                return parent[p];
//            }
        }
        public double dist(int x1,int y1,int x2,int y2){
            double e=(x2-x1)*(x2-x1)+(y2-y1)*(y2-y1);
            double e1=Math.sqrt(e);
            return e1;
        }
        public void make(int p){
            parent[p]=p;
            rank[p]=1;
        }
        Random rand = new Random();
        public void sort(long[] a, int n) {
                for (int i = 0; i < n; i++) {
                   int j = rand.nextInt(i + 1);
                   long tmp = a[i];
                   a[i] = a[j];
                   a[j] = tmp;
                }
                Arrays.sort(a, 0, n);
        }
        public long gcd(long a,long b){
               if(b==0){
                  return a;
               }
               return gcd(b,a%b);
        }
        private void dfs2(ArrayList<Integer>[]arrayList,int j,int count){
            ans[j]=count;
            for(int i:arrayList[j]){
                if(ans[i]==-1){
                    dfs2(arrayList,i,count);
                }
            }
        }
        private void dfs(ArrayList<Integer>[] arrayList, int j) {
            v[j]=true;
            count++;
            for(int i:arrayList[j]){
                if(v[i]==false) {
                    dfs(arrayList, i);
                }
            }
        }
        public long fact(long h){
            long sum=1;
            while(h>=1){
                sum=sum*h;
                h--;
            }
            return sum;
        }
        public long primef(double r){
            long c=0;
            while(r%2==0){
                c++;
                r=r/2;
            }
            for (int i = 3; i <=Math.sqrt(r) ;i+=2) {
                while(r%i==0){
                    c++;
                    r=r/3;
                }
            }
            if(r>2){
                c++;
            }
            return c;
        }
}

class Pair{
    long x;
    long y;
    long z;
    public Pair(long x,long y,long z){
        this.x=x;
        this.y=y;
        this.z=z;
    }
}
class Sorting implements Comparator<Pair> {
    public int compare(Pair p1,Pair p2){
        return Long.compare(p1.y,p2.y);
    }

}
