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.*;

public class Solution {
    static int n, k;
    static int arr[];
    static Integer ind[];

    static int binary() {
        int l = k / 2 - 1, r = n - 1;
        while (l <= r) {
            if (l == r)
                return arr[ind[l]];
            if (l + 1 == r) {
                if (ispossible(arr[ind[l]]))
                    return arr[ind[l]];
                return arr[ind[r]];
            }
            int m = (l + r) / 2;
            if (ispossible(arr[ind[m]]))
                r = m;
            else
                l = m + 1;
        }
        return 1 / 0;
    }

    static boolean ispossible(int z) {
        int add = 0;
        for (int i = 1; i <= n; i++) {
            if (add % 2 == 0) {
                if (arr[i] <= z)
                    add++;
            } else
                add++;
        }
        if (add >= k)
            return true;
        add = 0;
        for (int i = 1; i <= n; i++) {
            if (add % 2 == 1) {
                if (arr[i] <= z)
                    add++;
            } else
                add++;
        }
        if (add >= k)
            return true;
        return false;
    }

    public static void main(String[] args) throws Exception {
        int i, j;
        FastReader in = new FastReader(System.in);
        StringBuilder sb = new StringBuilder();
        boolean testcases = false;
        int t = testcases ? in.nextInt() : 1;
        while (t-- > 0) {
            n = in.nextInt();
            k = in.nextInt();
            arr = new int[n + 1];
            for (i = 1; i <= n; i++)
                arr[i] = in.nextInt();
            ind = new Integer[n];
            for (i = 0; i < n; i++)
                ind[i] = i + 1;
            Arrays.sort(ind, (a, b) -> Integer.compare(arr[a], arr[b]));
            sb.append(binary()).append("\n");
        }
        System.out.print(sb);
    }

}

class FastReader {

    byte[] buf = new byte[2048];
    int index, total;
    InputStream in;

    FastReader(InputStream is) {
        in = is;
    }

    int scan() throws IOException {
        if (index >= total) {
            index = 0;
            total = in.read(buf);
            if (total <= 0) {
                return -1;
            }
        }
        return buf[index++];
    }

    String next() throws IOException {
        int c;
        for (c = scan(); c <= 32; c = scan()) ;
        StringBuilder sb = new StringBuilder();
        for (; c > 32; c = scan()) {
            sb.append((char) c);
        }
        return sb.toString();
    }

    int nextInt() throws IOException {
        int c, val = 0;
        for (c = scan(); c <= 32; c = scan()) ;
        boolean neg = c == '-';
        if (c == '-' || c == '+') {
            c = scan();
        }
        for (; c >= '0' && c <= '9'; c = scan()) {
            val = (val << 3) + (val << 1) + (c & 15);
        }
        return neg ? -val : val;
    }

    long nextLong() throws IOException {
        int c;
        long val = 0;
        for (c = scan(); c <= 32; c = scan()) ;
        boolean neg = c == '-';
        if (c == '-' || c == '+') {
            c = scan();
        }
        for (; c >= '0' && c <= '9'; c = scan()) {
            val = (val << 3) + (val << 1) + (c & 15);
        }
        return neg ? -val : val;
    }
}


