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




/*

*/

public class Main {
	static FastReader sc=null;
	static int nax=(int)1e9+1;
	
	public static void main(String[] args) {
		sc=new FastReader();
		int n=sc.nextInt(),k=sc.nextInt();
		int a[]=sc.readArray(n);
		//we need to check if it is possible to pick (k/2) elements 
		//if we pick the first index, then we need it to be even indices
		int l=0,r=nax;
		//if(k%2==1)throw null;
		while(l+1<r) {
			int mid=(l+r)/2;
			if(poss(a,k,mid))r=mid;
			else l=mid;
		}
		System.out.println(r);
		
	}
	static boolean poss(int a[],int k,int v) {
		int n=a.length;
		int dp[][]=new int[n][2];
		dp[0][0]=(a[0]<=v?1:0);
		for(int i=1;i<n;i++) {
			for(int j=0;j<2;j++) {
				if(a[i]<=v)dp[i][j]=(i>1?dp[i-2][j]:0)+1;
				dp[i][j]=Math.max(dp[i][j], dp[i-1][j]);
			}
		}
		return (dp[n-(k%2==0?2:1)][0]>=(k+1)/2 || dp[n-(k%2+1)][1]>=k/2);
	}
	
	static int[] ruffleSort(int a[]) {
		ArrayList<Integer> al=new ArrayList<>();
		for(int i:a)al.add(i);
		Collections.sort(al);
		for(int i=0;i<a.length;i++)a[i]=al.get(i);
		return a;
	}
	static void print(int a[]) {
		for(int e:a) {
			System.out.print(e+" ");
		}
		System.out.println();
	}

	static class FastReader{
		
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		
		String next() {
			while(!st.hasMoreTokens())
				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());
		}
		
		int[] readArray(int n) {
			int a[]=new int[n];
			for(int i=0;i<n;i++)a[i]=sc.nextInt();
			return a;
		}
	}
}






