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 int INF=(int)2e9;
	static int solve(int target,int[]in,int n) {
		int ans=INF;
		int lo=1,hi=(int)1e9;
		while(lo<=hi) {
			int mid=(lo+hi)>>1;
			int[]last=new int[n],nxt=new int[n];
			for(int i=0;i<n;i++) {
				if(in[i]<=mid) {
					last[i]=i;
				}
				else {
					last[i]=i==0?-1:last[i-1];
				}
			}
			for(int i=n-1;i>=0;i--) {
				if(in[i]<=mid) {
					nxt[i]=i;
				}
				else {
					nxt[i]=i==n-1?-1:nxt[i+1];
				}
			}
			int[]seqPrev=new int[n],seqNxt=new int[n];
			for(int i=0;i<n;i++) {
				if(in[i]>mid)continue;
				int prev=i-2<0?-1:last[i-2];
				if(prev==-1) {
					seqPrev[i]=1;
				}
				else {
					seqPrev[i]=seqPrev[prev]+1;
				}
			}
			for(int i=n-1;i>=0;i--) {
				if(in[i]>mid)continue;
				int next=i+2>=n?-1:nxt[i+2];
				if(next==-1) {
					seqNxt[i]=1;
				}
				else {
					seqNxt[i]=seqNxt[next]+1;
				}
			}
			boolean yes=false;
			for(int i=0;i<n;i++) {
				int can=seqPrev[i]+seqNxt[i]-1;
				if(can>=target) {
					yes=true;
					break;
				}
			}
			if(yes) {
				ans=mid;
				hi=mid-1;
			}
			else {
				lo=mid+1;
			}
		}
		return ans;
	}
	static void main() throws Exception{
		int n=sc.nextInt(),k=sc.nextInt();
		int[]in=sc.intArr(n);
		int ans=INF;
		if((k&1)==0) {
			int[]inWithoutFirst=new int[n-1],inWithoutLast=new int[n-1];
			for(int i=1;i<n;i++) {
				inWithoutFirst[i-1]=in[i];
			}
			for(int i=0;i<n-1;i++) {
				inWithoutLast[i]=in[i];
			}
			ans=Math.min(ans, solve(k/2, inWithoutLast, n-1));
			ans=Math.min(ans, solve(k/2, inWithoutFirst, n-1));
		}
		else {
			int[]inWithoutFirstAndLast=new int[n-2];
			for(int i=1;i<n-1;i++) {
				inWithoutFirstAndLast[i-1]=in[i];
			}
			ans=Math.min(ans, solve(k/2, inWithoutFirstAndLast, n-2));
			ans=Math.min(ans, solve((k+1)/2, in, n));
		}
		
		
		pw.println(ans);
	}
	public static void main(String[] args) throws Exception{
		pw=new PrintWriter(System.out);
		sc = new MScanner(System.in);
		int tc=1;
//		tc=sc.nextInt();
		while(tc-->0)
			main();
		pw.flush();
	}
	static PrintWriter pw;
	static MScanner  sc;
	static class MScanner {
		StringTokenizer st;
		BufferedReader br;
		public MScanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}
 
		public MScanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}
 
		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int[] intArr(int n) throws IOException {
	        int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        return in;
		}
		public long[] longArr(int n) throws IOException {
	        long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        return in;
		}
		public int[] intSortedArr(int n) throws IOException {
	        int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        shuffle(in);
	        Arrays.sort(in);
	        return in;
		}
		public long[] longSortedArr(int n) throws IOException {
	        long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        shuffle(in);
	        Arrays.sort(in);
	        return in;
		}
		public Integer[] IntegerArr(int n) throws IOException {
	        Integer[]in=new Integer[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        return in;
		}
		public Long[] LongArr(int n) throws IOException {
	        Long[]in=new Long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        return in;
		}
		public String nextLine() throws IOException {
			return br.readLine();
		}
 
		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
 
		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
 
		public char nextChar() throws IOException {
			return next().charAt(0);
		}
 
		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}
 
		public boolean ready() throws IOException {
			return br.ready();
		}
 
		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
	static void shuffle(int[]in) {
		for(int i=0;i<in.length;i++) {
			int idx=(int)(Math.random()*in.length);
			int tmp=in[i];
			in[i]=in[idx];
			in[idx]=tmp;
		}
	}
	static void shuffle(long[]in) {
		for(int i=0;i<in.length;i++) {
			int idx=(int)(Math.random()*in.length);
			long tmp=in[i];
			in[i]=in[idx];
			in[idx]=tmp;
		}
	}
}