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

public class d651 implements Runnable{
	
    public static void main(String[] args) {
    	try{
            new Thread(null, new d651(), "process", 1<<26).start();
        }
        catch(Exception e){
            System.out.println(e);
        }
    }
	public void run() {
		FastReader scan = new FastReader();
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
		//PrintWriter out = new PrintWriter("file.out");
		Task solver = new Task();
		//int t = scan.nextInt();
		int t = 1;
		for(int i = 1; i <= t; i++) solver.solve(i, scan, out);
		out.close();
	}

	static class Task {
		static final int inf = Integer.MAX_VALUE;

		static int requiredSelections;
		public void solve(int testNumber, FastReader sc, PrintWriter out) {
			int N = sc.nextInt();
			int K = sc.nextInt();
			
			int[] arr = new int[N];
			int[] sorted = new int[N];
			for(int i = 0; i < N; i++) {
				arr[i] = sc.nextInt();
				sorted[i] = arr[i];
			}
			Arrays.sort(sorted);
			
			int lo = 0, hi = arr.length - 1; int mid = -1;
	        while (lo < hi) { 
	            mid = (lo + hi) / 2; 
	            //System.out.println(sorted[lo] + " " + sorted[mid] + " " + sorted[hi]);
	            if (works(arr, sorted[mid], K)) {
	            	//System.out.println(sorted[lo] + " " + sorted[mid] + " " + sorted[hi]);
	            	if(sorted[lo] == sorted[mid]) {
	            		break;
	            	}
	            	hi = mid;
	            }
	            else
	            	lo = mid+1; 
	        }
	        out.println(sorted[lo]);
		}
		
		public static boolean works(int[] arr, int max, int K) {
			boolean works = false;
			if(true) { // trial 1
				List<Integer> s1 = new ArrayList<>();
				List<Integer> s2 = new ArrayList<>();
				
				int turn = 1;
				for(int i = 0; i < arr.length; i++) {
					if(turn == 2) {
						s2.add(i);
						turn = 1;
					} else {
						if(arr[i] <= max) {
							s1.add(i);
							turn = 2;
						}
					}
				}
				works = works || (s1.size() + s2.size() >= K);
			}
			if(true) { // trial 1
				List<Integer> s1 = new ArrayList<>();
				List<Integer> s2 = new ArrayList<>();
				
				int turn = 2;
				for(int i = 0; i < arr.length; i++) {
					if(turn == 2) {
						s2.add(i);
						turn = 1;
					} else {
						if(arr[i] <= max) {
							s1.add(i);
							turn = 2;
						}
					}
				}
				works = works || (s1.size() + s2.size() >= K);
			}
			
			//System.out.println(max + " " + works);
			
			return works;
		}
	}
	static long binpow(long a, long b, long m) {
		a %= m;
		long res = 1;
		while (b > 0) {
			if ((b & 1) == 1)
				res = res * a % m;
			a = a * a % m;
			b >>= 1;
		}
		return res;
	}
	static void sort(int[] x){
		shuffle(x);
		Arrays.sort(x);
	}
	static void sort(long[] x){
		shuffle(x);
		Arrays.sort(x);
	}
	static class tup implements Comparable<tup>, Comparator<tup>{
		int a, b;
		tup(int a,int b){
			this.a=a;
			this.b=b;
		}
		public tup() {
		}
		@Override
		public int compareTo(tup o){
			return Integer.compare(b,o.b);
		}
		@Override
		public int compare(tup o1, tup o2) {
			return Integer.compare(o1.b, o2.b);
		}
		
		@Override
	    public int hashCode() {
			return Objects.hash(a, b);
	    }
 
	    @Override
	    public boolean equals(Object obj) {
	    	if (this == obj)
                return true;
	    	if (obj == null)
                return false;
	    	if (getClass() != obj.getClass())
                return false;
	    	tup other = (tup) obj;
	    	return a==other.a && b==other.b;
	    }
	    
	    @Override
	    public String toString() {
	    	return a + " " + b;
	    }
	}
	
	static void shuffle(int[] a) {
		Random get = new Random();
		for (int i = 0; i < a.length; i++) {
			int r = get.nextInt(a.length);
			int temp = a[i];
			a[i] = a[r];
			a[r] = temp;
		}
	}

	static void shuffle(long[] a) {
		Random get = new Random();
		for (int i = 0; i < a.length; i++) {
			int r = get.nextInt(a.length);
			long temp = a[i];
			a[i] = a[r];
			a[r] = temp;
		}
	}

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

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

		public FastReader(String s) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(new File(s)));
		}

		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;
		}
	}

}