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 D {
    static int check(int[] arr,int m){
        int max = 0;
        boolean t = false;
        int a = 0;
        for(int i=0;i<arr.length;i++){
            if(arr[i]<=m && t){
                a++;
                t = false;
            }else if(!t){
                a++;
                t = true;
            }
        }
        max = a;
         t = true;
        a = 0;
        for(int i=0;i<arr.length;i++){
            if(arr[i]<=m && t){
                a++;
                t = false;
            }else if(!t){
                a++;
                t = true;
            }
        }
        return Math.max(max,a);
    }
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int[] arr = new int[n];
        PriorityQueue<Integer> tr = new PriorityQueue<>();
        for(int i=0;i<n;i++){arr[i] = sc.nextInt();tr.add(arr[i]);};
        int[] sorted = new int[tr.size()];
        for(int i=0;i<sorted.length;i++)sorted[i] = tr.poll();
        int l = 0;
        int r = sorted.length-1;
        int mid = 0;
        int res = 1000000000;
        while (l<=r){
            mid = (r+l)/2;
           // System.out.println(mid+ " "  + check(arr,sorted[mid]));
            if(check(arr,sorted[mid])>=k){
                res = Math.min(res,sorted[mid]);
                r = mid-1;
            }else{
                l = mid+1;
            }
        }
        pw.println(res);
        pw.flush();
        pw.close();
    }
    static class Pair implements Comparable<Pair>{
        int x;
        int y;
        int z;
        int d;
        public Pair(int x,int y,int z){
            this.x= x;
            this.y = y;
            this.z =z;
            d = z-y;
        }
        public int compareTo(Pair p){
            if(this.d==p.d)
                return Long.compare(p.x,this.x);
            return Long.compare(this.d,p.d);
        }

    }
    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(FileReader r) {
            br = new BufferedReader(r);
        }

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

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

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

        public String nextLine() throws IOException {
            return br.readLine();
        }

        public double nextDouble() throws IOException {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if (x.charAt(0) == '-') {
                neg = true;
                start++;
            }
            for (int i = start; i < x.length(); i++)
                if (x.charAt(i) == '.') {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } else {
                    sb.append(x.charAt(i));
                    if (dec)
                        f *= 10;
                }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg ? -1 : 1);
        }

        public boolean ready() throws IOException {
            return br.ready();

        }
    }
}