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 OddEvenSubsequence {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        solver.solve(in, out);
        out.close();
    }
    // main solver
    static class Task {
        public void solve(InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int k = in.nextInt();
            int a[] = new int[n];
            for  (int i = 0; i < n; i++){
                a[i] = in.nextInt();
            }
            int beg = 1;
            int end = 1000000000;
            while (beg < end){
                int mid = (beg + end) / 2;
                if (exist(a, mid, k)){
                    end = mid;
                }
                else{
                    beg = mid + 1;
                }
            }
            out.println(beg);
        }
        // exist a subsequence >= k in length with all odd | even indexes elements <= tar;
        private boolean exist(int[] a, int tar, int k) {
            int oddFirst = 0;// all odd indexes elements <= tar;
            int evenFirst = 0; // allEven indexes elements <= tar;
            int i = 1, start;
            // all oddElements <= k;
            start = a[0]; oddFirst = 1;
            while (i < a.length){
                if (a[i] <= tar){
                    if (i != a.length - 1){
                        oddFirst += 2;
                    }
                    else{
                        oddFirst++;
                    }
                    i += 2;
                }
                else{
                    i++;
                }
            }
            // if exist an array with all elements in odd position <= target;
            if (oddFirst >= k){
                return true;
            }
            i = 0;
            while (i < a.length){
                if (a[i] <= tar){
                    if  (i != a.length - 1) {
                        evenFirst += 2;
                    }
                    else{
                        evenFirst++;
                    }
                    i += 2;
                }
                else{
                    i++;
                }
            }
            if (evenFirst >= k){
                return true;
            }else{
                return false;
            }
        }
    }

    private static class Pair implements Comparable<Pair>{
        public int val, index;
        public Pair(int index, int val){
            this.index = index;
            this.val = val;
        }

        @Override
        public int compareTo(Pair o) {
            if (this.val > o.val){
                return 1;
            }
            else if (this.val < o.val){
                return -1;
            }
            else{
                if (o.index < this.index){
                    return 1;
                }
                else if (o.index > this.index){
                    return -1;
                }
                else{
                    return 0;
                }
            }
        }
    }
    // fast input reader class;
    static class InputReader {
        BufferedReader br;
        StringTokenizer st;

        public InputReader(InputStream stream) {
            br = new BufferedReader(new InputStreamReader(stream));
        }

        public String nextToken() {
            while (st == null || !st.hasMoreTokens()) {
                String line = null;
                try {
                    line = br.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
                if (line == null) {
                    return null;
                }
                st = new StringTokenizer(line);
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(nextToken());
        }
        public long nextLong(){
            return Long.parseLong(nextToken());
        }
    }
}
