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.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.TreeSet;
public class D651 {

	public static void main(String[] args) {
		FastScanner in = new FastScanner(System.in);
		int N = in.nextInt();
		int K = in.nextInt();
		StringBuilder sb = new StringBuilder();
		
		int[] arr = new int[N];
		for(int i = 0; i < N; i++) {
			arr[i] = in.nextInt();
		}
		
		int ans = ans(N, K, arr);
		
		sb.append(ans);
		sb.append("\n");
		
		
		System.out.print(sb);

	}
	
	public static int ans(int N, int K, int[] arr) {
		TreeSet<Integer> ts = new TreeSet<>();
		for(int i : arr) {
			ts.add(i);
		}
		
		int[] sortedSet = new int[ts.size()];
		int index = 0;
		for(int i : ts) {
			sortedSet[index++] = i;
		}
		//System.out.println("Sortrd set = " + Arrays.toString(sortedSet));
		
		int[] copy = new int[arr.length];
		for(int i = 0; i < copy.length; i++) {
			copy[i] = arr[i];
		}
		
		Arrays.sort(copy);
		
		int low = 0;
		int high = sortedSet.length - 1;
		
		while(low <= high) {
			int mid = (low + high) / 2;
			
		//	System.out.println("mid index = " + mid);
			boolean b = ansAtLeast(sortedSet[mid], K, arr, copy);
		//	System.out.println("is answer at least " + sortedSet[mid] + " ? " + b);
			
			
			if(b) {
				high = mid - 1;
			}
			else {
				low = mid + 1;
			}
		//	System.out.println("after, low high = " + low + " " + high);
		}
		
		int indexAns = low;
		
		return sortedSet[indexAns];
	}
	
	public static boolean ansAtLeast(int ans, int K, int[] arr, int[] sorted) {
		int myK = K/2;
		
		int myCount = 0;
		for(int i : arr) {
			if(i <= ans)
				myCount++;
		}
		if(myCount < myK) {
			return false;
		}
		
		ArrayList<Integer> temp = new ArrayList<>();
		for(int i = 0; i < arr.length; i++) {
			if(arr[i] <= ans) {
				temp.add(i);
			}
		}
		
		ArrayList<Integer> temp2 = new ArrayList<>();
		temp2.add(temp.get(0));
		for(int i = 1; i < temp.size(); i++) {
			if(temp.get(i) - temp2.get(temp2.size() - 1) > 1) {
				temp2.add(temp.get(i));
			}
		}
		
		//System.out.println("temp2 =" + temp2);
		if(temp2.size() >= K/2) {
			//return true;
			
			
			if(K % 2 == 1) {
				if(temp2.size() >= (K/2) + 1) {
					return true;
				}
				
				if(temp2.get(0) > 0 && temp2.get(temp2.size() - 1) < arr.length - 1) {
					return true;
				}
			}
			else {
				if(temp2.get(0) > 0 || temp2.get(temp2.size() - 1) < arr.length - 1) {
					return true;
				}
				
				if(temp2.size() - 1 >= (K/2)) {
					return true;
				}
			}
		}
		
		if(temp.size() >= 2) {
			ArrayList<Integer> temp3 = new ArrayList<>();
			temp3.add(temp.get(1));
			for(int i = 2; i < temp.size(); i++) {
				if(temp.get(i) - temp3.get(temp3.size() - 1) > 1) {
					temp3.add(temp.get(i));
				}
			}
			
			//System.out.println("temp3 = " + temp3);
			if(temp3.size() >= K/2) {
				//return true;
				
				if(K % 2 == 1) {
					if(temp3.size() >= (K/2) + 1) {
						return true;
					}
					if(temp3.get(0) > 0 && temp3.get(temp3.size() - 1) < arr.length - 1) {
						return true;
					}
				}
				else {
					
					if(temp3.get(0) > 0 || temp3.get(temp3.size() - 1) < arr.length - 1) {
						return true;
					}
					
					if(temp3.size() - 1 >= (K/2)) {
						return true;
					}
					
					return true;
				}
			}
		}
		
		
		return false;
	}
	
	/**
	 * Source: Matt Fontaine
	 */
	static class FastScanner {
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int chars;

		public FastScanner(InputStream stream) {
			this.stream = stream;
		}

		int read() {
			if (chars == -1)
				throw new InputMismatchException();
			if (curChar >= chars) {
				curChar = 0;
				try {
					chars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (chars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		boolean isEndline(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public String next() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public String nextLine() {
			int c = read();
			while (isEndline(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndline(c));
			return res.toString();
		}
	}

}
/*
4 2
1 2 3 4
outputCopy
1
inputCopy
4 3
1 2 3 4
outputCopy
2
inputCopy
5 3
5 3 4 2 6
outputCopy
2
inputCopy
6 4
5 3 50 2 4 5
outputCopy
3

4 4
1 2 2 1

2

*/