Ashish has an array a of size n.

A subsequence of a is defined as a sequence that can be obtained from a by deleting some elements (possibly none), without changing the order of the remaining elements.

Consider a subsequence s of a. He defines the cost of s as the minimum between: 

  * The maximum among all elements at odd indices of s. 
  * The maximum among all elements at even indices of s. 



Note that the index of an element is its index in s, rather than its index in a. The positions are numbered from 1. So, the cost of s is equal to min(max(s_1, s_3, s_5, …), max(s_2, s_4, s_6, …)).

For example, the cost of \{7, 5, 6\} is min( max(7, 6), max(5) ) = min(7, 5) = 5.

Help him find the minimum cost of a subsequence of size k.

Input

The first line contains two integers n and k (2 ≤ k ≤ n ≤ 2 ⋅ 10^5) — the size of the array a and the size of the subsequence.

The next line contains n integers a_1, a_2, …, a_n (1 ≤ a_i ≤ 10^9) — the elements of the array a.

Output

Output a single integer — the minimum cost of a subsequence of size k.

Examples

Input


4 2
1 2 3 4


Output


1

Input


4 3
1 2 3 4


Output


2

Input


5 3
5 3 4 2 6


Output


2

Input


6 4
5 3 50 2 4 5


Output


3

Note

In the first test, consider the subsequence s = \{1, 3\}. Here the cost is equal to min(max(1), max(3)) = 1.

In the second test, consider the subsequence s = \{1, 2, 4\}. Here the cost is equal to min(max(1, 4), max(2)) = 2.

In the fourth test, consider the subsequence s = \{3, 50, 2, 4\}. Here the cost is equal to min(max(3, 2), max(50, 4)) = 3.
//package graphs;
import java.util.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class PW {
	
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		FastReader s = new FastReader();
	    
//		int t=s.nextInt();
//		
		int n=s.nextInt();
		int k=s.nextInt();
		int a[]=new int[n];
		
		for(int i=0;i<n;i++)
			a[i]=s.nextInt();
		
		long l=1,e=Integer.MAX_VALUE;
		long ans=-1;
		
		while(l<=e)
		{
			long mid=(l+e)/2;
			
			if(solve(mid,k,a)==true)
			{
				ans=mid;
				e=mid-1;
			}
			else
				l=mid+1;
			
		}
		
		System.out.println(ans);
	
	}
//	1  4   8
	 
	public static boolean solve(long n,int k,int a[])
	{
		 int c=0;
		 
		 for(int i=0;i<a.length;i++)
		 {
			 if(c%2==0)
			 {
				 if(a[i]<=n)
					 c++;
			 }
			 else
			 {
				 c++;
			 }
		 }
	     
		 if( c>=k)
			 return true;
		 
         c=0;
		 
		 for(int i=0;i<a.length;i++)
		 {
			 if(c%2==1)
			 {
				 if(a[i]<=n)
					 c++;
			 }
			 else
			 {
				 c++;
			 }
		 }
	     
		 return c>=k? true:false;
		 
	    }
	    
	    public static String largestNumber( List<String> ab) {
	        
	       // List<String> ab= new ArrayList<>();
	       // for(int i=0;i<A.size();i++)
	       // {
	       //     ab.add(String.valueOf(A.get(i)));
	       // }
	        
	        Collections.sort(ab, new Comparator<String>(){ 
	            
	            public int compare(String X, String Y) { 
	          
	        // first append Y at the end of X 
	        String XY=X + Y; 
	          
	        // then append X at the end of Y 
	        String YX=Y + X; 
	          
	        // Now see which of the two formed numbers  
	        // is greater 
	        return XY.compareTo(YX)>0?-1:1; 
	            
	                
	            }
	            
	            
	            
	        });
	        StringBuilder abc= new StringBuilder();
	        
	        
	        for(int i=0;i<ab.size();i++)
	        {
	           abc.append(ab.get(i));
	            
	        }
	        if(abc.length()==0)
	            return abc.toString();
	        
	        if(abc.charAt(0)=='0')
	        return "0";
	        else
	        return abc.toString();
	        
	    }
	
	public static boolean pal(String s)
	{
		int i=0;
		int j=s.length()-1;
		while(i<=j)
		{
			if(s.charAt(i)!=s.charAt(j))
				return false;
			i++;
			j--;
		}
		return true;
	}
	
	
	
	
	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;
        }
    }

	
	public static long solve(int n, int r)
    {


        long p = 1, k = 1;
        if (n - r < r) {
            r = n - r;
        }
 
        if (r != 0) {
            while (r > 0) {
                p *= n;
                k *= r;
 
                long m = __gcd(p, k);
 
                
                p /= m;
                k /= m;
 
                n--;
                r--;
            }
 
           
        }
        else {
            p = 1;
        }
 
        
        //System.out.println(p);
        return p;
    }
	
	
	public static long gcd(long a,long b)
	{
		if(a==0||b==0)
			return a+b;
		return gcd(b,(a%b));
	}
	
	public static long __gcd(long n1, long n2)
    {
        long gcd = 1;
 
        for (int i = 1; i <= n1 && i <= n2; ++i) {
            // Checks if i is factor of both integers
            if (n1 % i == 0 && n2 % i == 0) {
                gcd = i;
            }
        }
        return gcd;
    }
	
	public static boolean prime(int n)
	{
		if(n<=2)
			return true;
		
		for(int i=2;i<=Math.sqrt(n);i++)
		{
			if(n%i==0)
				return false;
		}
		
		return true;
		
	}
	public static long fastExpo(long a,long n,long mod){
        if (n == 0)
            return 1;
        else{
            long x = fastExpo(a,n/2,mod);
            if ((n&1) == 1){
                return (((a*x)%mod)*x)%mod;
            }
            else{
                return (((x%mod)*(x%mod))%mod)%mod;
            }
        }
    }
}
class pair{
	//public:
		long f;
		long s;
		pair(long x,long y)
		{
			f=x;
			s=y;
		}
        
}


