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.util.*;
import java.io.*;
public class Main implements Runnable{
    FastScanner sc;
    PrintWriter pw;
    final class FastScanner {
        BufferedReader br;
        StringTokenizer st;
 
        public FastScanner() {
            try {
                br = new BufferedReader(new InputStreamReader(System.in));
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
 
        public long nlo() {
            return Long.parseLong(next());
        }
 
        public String next() {
            if (st.hasMoreTokens()) return st.nextToken();
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                e.printStackTrace();
            }
            return st.nextToken();
        }
 
        public int ni() {
            return Integer.parseInt(next());
        }
 
        public String nli() {
            String line = "";
            if (st.hasMoreTokens()) line = st.nextToken();
            else try {
                return br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            while (st.hasMoreTokens()) line += " " + st.nextToken();
            return line;
        }
 
        public double nd() {
            return Double.parseDouble(next());
        }
    }
    public static void main(String[] args) throws Exception
    {
        new Thread(null,new Main(),"codeforces",1<<28).start();
    }
    public void run()
    {
        sc=new FastScanner();
        pw=new PrintWriter(System.out);
        solve();
        pw.flush();
        pw.close();
    }
    public long gcd(long a,long b)
    {
        return b==0L?a:gcd(b,a%b);
    }
    public long ppow(long a,long b,long mod)
    {
        if(b==0L)
        return 1L;
        long tmp=1;
        while(b>1L)
        {
            if((b&1L)==1)
            tmp*=a;
            a*=a;
            a%=mod;
            tmp%=mod;
            b>>=1;
        }
        return (tmp*a)%mod;
    }
    public  int gcd(int x,int y)
    {
        return y==0?x:gcd(y,x%y);
    }
   
    //////////////////////////////////
    /////////////  LOGIC  ///////////
    ////////////////////////////////
    public int[] seg;
    public int qrr;
    public void solve(){
        int t=1;
        while(t-->0)
        {
            int n=sc.ni();
            int k=sc.ni();
            int[] arr=new int[n];
            for(int i=0;i<n;i++)
            arr[i]=sc.ni();
            int[] brr=arr.clone();
            Arrays.sort(arr);
            int ans=arr[n-1];
            int l=0,r=n-1;
            while(l<=r)
            {
                int m=(l+r)/2;
                if(f(arr[m],brr,k)||g(arr[m],brr,k))
                {
                    ans=arr[m];
                    r=m-1;
                }
                else
                l=m+1;
            }
            pw.println(ans);
        }
    }
    public boolean f(int x,int[] arr,int k)
    {
       
        int n=arr.length;
        int i=0;
        int req=k%2==0?k/2:k/2+1;
        int done=0;
        while(i<n&&arr[i]>x)
        i++;
        if(i<n)
            {done++;}
        i+=2;
        int last=i-2;;
       
        for(;i<n&&done<req;i++)
        {
            while(i<n&&arr[i]>x)
            i++;
            if(i<n)
            {
                last=i;
                {done++;}
                i++;
            }
        }   
        if(done<req)
        return false;
        if(k%2==0&&req==done&&last==n-1)
        return false;
        return true;

    }
    public boolean g(int x,int[] arr,int k)
    {
        int n=arr.length;
        int req=k/2;
        int done=0;
        int last=-1;
       
        for(int i=1;i<n&&done<req;i++)
        {
            while(i<n&&arr[i]>x)
            i++;
            if(i<n)
            {
                last=i;
                {done++;}
                i++;
            }
        }
        if(done<req)
        return false;
        if(k%2==1&&req==done&&last==n-1)
        return false;
        return true;
    }
}