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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.StringTokenizer;

public class Task4 {

    public static void main(String[] args) throws IOException {
        new Task4().solve();
    }

    private void solve() throws IOException {
        BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);

        StringTokenizer tokenizer = new StringTokenizer(f.readLine());
        int n = Integer.parseInt(tokenizer.nextToken());
        int k = Integer.parseInt(tokenizer.nextToken());
        int[] seq = new int[n];
        tokenizer = new StringTokenizer(f.readLine());
        for (int i = 0; i < n; i++) {
            seq[i] = Integer.parseInt(tokenizer.nextToken());
        }
        ArrayList<Node1> sortedOddPossibility = new ArrayList<Node1>();
        int to = n;
        if (k % 2 == 0) to--;
        for (int i = 0; i < to; i++) {
            sortedOddPossibility.add(new Node1(seq[i], i));
        }

        int req1 = k / 2;
        if (k % 2 == 1) req1++;
        int min1 = getMin(sortedOddPossibility, req1);

        ArrayList<Node1> sortedNotOddPossibility = new ArrayList<Node1>();
        to = n;
        if (k % 2 == 1) to--;
        for (int i = 1; i < to; i++) {
            sortedNotOddPossibility.add(new Node1(seq[i], i));
        }

        int req2 = k / 2;
        int min2 = getMin(sortedNotOddPossibility, req2);

        out.println(Math.min(min1, min2));
        out.close();
    }

    private int getMin(ArrayList<Node1> node1s, int required) {
        int a = 0;
        int b = Integer.MAX_VALUE;
        int res = -1;
        while (a <= b) {
            int mid = (a + b) / 2;
            if (isPossible(node1s, mid, required)) {
                res = mid;
                b = mid - 1;
            } else {
                a = mid + 1;
            }
        }

        return res;
    }

    private static boolean isPossible(ArrayList<Node1> nodes, int upTo, int required) {
        int previousIndex = -2;
        int have = 0;
        for (int i = 0; i < nodes.size();) {
            if (nodes.get(i).value <= upTo) {
                have++;
                i += 2;
            } else {
                i++;
            }
        }
        //System.out.println(have + " " + nodes + " " +required);
        return have >= required;
    }

    private static class Node1 implements Comparable<Node1> {
        int value;
        int index;

        public Node1(int value, int index) {
            this.value = value;
            this.index = index;
        }

        @Override
        public int compareTo(Node1 node1) {
            if (this.value < node1.value) {
                return -1;
            }
            if (this.value > node1.value) {
                return 1;
            }

            return 0;
        }
    }

    private static class NodeComparator implements Comparator<Node1> {
        @Override
        public int compare(Node1 node1, Node1 t1) {
            if (node1.index < t1.index) {
                return -1;
            }
            if (node1.index > t1.index) {
                return 1;
            }

            return 0;
        }
    }
 }
