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.io.IOException;
import java.lang.Thread.State;
import java.util.*;
//import javafx.util.Pair; 
//import java.util.concurrent.LinkedBlockingDeque;






    
  public class Codeforces {
        
        public static long mod = (long)Math.pow(2,32) ;
        public static double epsilon=0.00000000008854;//value of epsilon
        public static InputReader sc = new InputReader(System.in);
        public static PrintWriter pw = new PrintWriter(System.out);
        
        public static ArrayList<ArrayList <Integer>> GetGraph(int n,int m){
            ArrayList<ArrayList <Integer>> g=new ArrayList<>();
            for(int i=0;i<n;i++){
                g.add(new ArrayList<>());
            }
            for(int i=0;i<m;i++){
                //int t=sc.nextInt();
                int u=sc.nextInt()-1;
                int v=sc.nextInt()-1;
                g.get(u).add(v);
                //if(t==0)
                g.get(v).add(u);
            }
            return g;
        }
        
        public static int find(int a,int p[]){
            if(a!=p[a]){
               p[a]=find(p[a], p);
            }
             return p[a];
        }
        public static void Union(int a,int b,int p[]){
            p[find(b, p)]=find(a, p);
        }
        public static long gcd(long a,long b){
            while(b>0){
                long t=b;
                b=a%b;
                a=t;
            }
            return a;
        }
        public static int dfs(ArrayList<ArrayList <Integer>> g,int u,int vis[],int p[],int down[]){
            vis[u]=1;
            int c=p[u];
            for(int i=0;i<g.get(u).size();i++){
                int v=g.get(u).get(i);
                if(vis[v]==0){
                    c+=dfs(g, v, vis, p, down);
                }
            }
            down[u]=c;
            return c;
        }
        public static boolean dfs1(ArrayList<ArrayList <Integer>> g,int u,int vis[],int bad[],int good[],int p[]){
            
            boolean ans=true;
            int g1=0,b1=0;
            vis[u]=1;
            for(int i=0;i<g.get(u).size();i++){
                int v=g.get(u).get(i);
                if(vis[v]==0){
                    g1+=good[v];
                    b1+=bad[v];
                    if(!dfs1(g, v, vis, bad, good,p)){
                        return false;
                    }
                }
            }
            if(g1>good[u]||(g1+b1+p[u])!=(good[u]+bad[u])){
                
                return false;
            }
            return true;
        }
        public static void sieve(int n,ArrayList<Integer> p){
            int a[]=new int[n+1];
            Arrays.fill(a, 1);
            for(int i=2;i<=Math.sqrt(n);i++){
                if(a[i]==1)
                for(int j=i*i;j<=n;j+=i){
                    a[j]=0;
                }
            }
            for(int i=2;i<=n;i++){
                if(a[i]==1){
                    p.add(i);
                }
            }
            
        }
        public static double pow(int n,double a){
            double ans=1;
            while(n>0){
                if(n%2==1){
                    ans*=a;
                }
                a*=a;
                n/=2;
            }
            return ans;
        }
        public static long[][] multiply(long a[][], long b[][]) 
    { 
        long mul[][] = new long[a.length][b[0].length]; 
        for (int i = 0; i < a.length; i++) 
        { 
            for (int j = 0; j < b[0].length; j++) 
            { 
                mul[i][j] = 0; 
                for (int k = 0; k < a[0].length; k++) 
                    mul[i][j] += (a[i][k] * b[k][j])%mod;
                    mul[i][j] %= mod;
            } 
        } 
      
        return mul;
    
    } 
      
    public static long[][] power(long F[][], long n) 
    { 
        
    	long[][] result = new long[F.length][F.length];
    	for(int i=0; i<F.length; i++)
    		result[i][i] = 1;
    	
    	
    	while (n > 0) {
			if (n % 2 == 1)
				result = multiply(result, F);
			
			F = multiply(F, F);
			n = n / 2;
			//System.out.println("==");
		}
    	return result;
    }
        
    public static int [] bfs(int s, ArrayList<ArrayList<Integer>> list, boolean vis[])
    {
       // add your code here
       //if(root==null){return;}
        Deque <Integer> qu=new LinkedList<>();
        
        int h[]=new int[vis.length];
        qu.add(s);
        vis[s]=true;
        int t=0;
        while(qu.size()>0){
            int n=qu.size();
            while(n-->0){
                int root=qu.remove();
                h[root]=t;
                for(int i=0;i<list.get(root).size();i++){
                    int node=list.get(root).get(i);
                    if(!vis[node]){
                        vis[node]=true;
                        qu.add(node);
                    }
                }
            }
            t++;
        }
        return h;
    }
    public static String stringReduction(int k, String s) {
        // Write your code here
        StringBuffer out=new StringBuffer();
        HashSet<Integer> h=new HashSet<>();
        Stack<Integer> st=new Stack<>();
        for(int i=0;i<s.length();i++){
            if(k==0){
                break;
            }
            while(k>0&&st.size()>0&&s.charAt(st.peek())<s.charAt(i)){
                h.add(st.pop());
                k--;
            }
            st.add(i);
        }
        while(k>0){
            st.pop();
            k--;
        }
        while(st.size()>0){
            out.append(s.charAt(st.pop()));
        }
        out=out.reverse();
        return out.toString();
    
        }
        public static void getMinInsertions(List<Integer> f1, List<Integer> f2) {
            // Write your code here
            HashMap<Integer,Integer>h=new HashMap<>();
            ArrayList<Integer> l=new ArrayList<>();
            for(int i=0;i<f2.size();i++){
                h.put(f2.get(i), i);
            }
            
            int a[]=new int[f1.size()];
            Arrays.fill(a, 0);
            int n=f1.size();
            for(int i=0;i<n;i++){
                if(h.containsKey(f1.get(i))){
                    a[i]=h.get(f1.get(i))+1;
                }
            }
            int dp[]=new int[n+1];
            SegmentTree tr=new SegmentTree(100001);
            for(int i=0;i<a.length;i++){
                int k=tr.getValue(0, a[i]-1);
                dp[a[i]]=Math.max(dp[a[i]], k+1);
                dp[0]=0;

                tr.update(dp[a[i]], a[i]);
            }
            pw.println(Arrays.toString(dp));
            pw.println(f2.size()-dp[f2.size()]);
        
            }
            
        public static void main(String[] args) {
            // code starts..
            int n=sc.nextInt();
            int k=sc.nextInt();
            long a[]=scanLongArray(n);
            long l=1;
            long r=Long.MAX_VALUE;
            long ans=r;
            while(l<=r){
                long mid=(l+r)/2;
                int dp[]=new int[n];
                int max1=0,max2=0;
                for(int i=0;i<n-(k%2==0?1:0);i++){
                    if(a[i]<=mid){
                        dp[i]++;
                    }
                    if(i>2){
                        dp[i]+=Math.max(dp[i-2], dp[i-3]);
                    }
                    else if(i>1){
                        dp[i]+=dp[i-2];
                    }
                    max1=Math.max(dp[i],max1);
                }
                //pw.println(mid+" "+Arrays.toString(dp));

                 dp=new int[n];
                for(int i=1;i<n-k%2;i++){
                    //int max=0;
                    if(a[i]<=mid){
                        dp[i]++;
                    }
                    if(i>2){
                        dp[i]+=Math.max(dp[i-2], dp[i-3]);
                    }
                    else if(i>1){
                        dp[i]+=dp[i-2];
                    }
                    max2=Math.max(dp[i],max2);
                }
                //pw.println(mid+" "+Arrays.toString(dp));
                if(max1>=(k/2+k%2)||max2>=(k/2)){
                    ans=mid;
                    r=mid-1;
                }
                else{
                    l=mid+1;
                }

            }
            pw.println(ans);
            // Code ends...
            pw.flush();
            pw.close();
        }
       
        public static Comparator<Long[]> column(int i){
            return 
            new Comparator<Long[]>() {
                @Override
                public int compare(Long[] o1, Long[] o2) {
                    return o1[i].compareTo(o2[i]);//for ascending
                    //return o2[i].compareTo(o1[i]);//for descending
                }
            };
        }
        public static Comparator<Pair> C(){
            return 
            new Comparator<Pair>() {
                @Override
                public int compare(Pair o1, Pair o2) {
                    return o2.le-o1.le;//for des
                }
            };
        }
        
        public static Comparator<Integer[]> pair(){
            return 
            new Comparator<Integer[]>() {
                @Override
                public int compare(Integer[] o1, Integer[] o2) {
                    int result=o1[0].compareTo(o2[0]);
                    if(result==0)
                    result=o1[1].compareTo(o2[1]);
                    return result;
                }
            };
        }
        
        public static String reverseString(String s){
            StringBuilder input1 = new StringBuilder(); 
            input1.append(s);  
            input1 = input1.reverse();
            return input1.toString();
        }
        public static int[] scanArray(int n){
            int a[]=new int [n];
            for(int i=0;i<n;i++)
            a[i]=sc.nextInt();
    
            return a;
        }
        public static long[] scanLongArray(int n){
            long a[]=new long [n];
            for(int i=0;i<n;i++)
            a[i]=sc.nextLong();
    
            return a;
        }
        public static String [] scanStrings(int n){
            String a[]=new String [n];
            for(int i=0;i<n;i++)
            a[i]=sc.nextLine();
    
            return a;
        }
        public static class InputReader {
    
            private final InputStream stream;
            private final byte[] buf = new byte[8192];
            private int curChar, snumChars;
            private SpaceCharFilter filter;
    
            public InputReader(InputStream stream) {
                this.stream = stream;
            }
    
            public int snext() {
                if (snumChars == -1)
                    throw new InputMismatchException();
                if (curChar >= snumChars) {
                    curChar = 0;
                    try {
                        snumChars = stream.read(buf);
                    } catch (IOException e) {
                        throw new InputMismatchException();
                    }
                    if (snumChars <= 0)
                        return -1;
                }
                return buf[curChar++];
            }
    
            public int nextInt() {
                int c = snext();
                while (isSpaceChar(c)) {
                    c = snext();
                }
                int sgn = 1;
                if (c == '-') {
                    sgn = -1;
                    c = snext();
                }
                int res = 0;
                do {
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = snext();
                } while (!isSpaceChar(c));
                return res * sgn;
            }
    
            public long nextLong() {
                int c = snext();
                while (isSpaceChar(c)) {
                    c = snext();
                }
                int sgn = 1;
                if (c == '-') {
                    sgn = -1;
                    c = snext();
                }
                long res = 0;
                do {
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = snext();
                } while (!isSpaceChar(c));
                return res * sgn;
            }
    
            public int[] nextIntArray(int n) {
                int a[] = new int[n];
                for (int i = 0; i < n; i++) {
                    a[i] = nextInt();
                }
                return a;
            }
    
            public String readString() {
                int c = snext();
                while (isSpaceChar(c)) {
                    c = snext();
                }
                StringBuilder res = new StringBuilder();
                do {
                    res.appendCodePoint(c);
                    c = snext();
                } while (!isSpaceChar(c));
                return res.toString();
            }
    
            public String nextLine() {
                int c = snext();
                while (isSpaceChar(c))
                    c = snext();
                StringBuilder res = new StringBuilder();
                do {
                    res.appendCodePoint(c);
                    c = snext();
                } while (!isEndOfLine(c));
                return res.toString();
            }
    
            public boolean isSpaceChar(int c) {
                if (filter != null)
                    return filter.isSpaceChar(c);
                return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
            }
    
            private boolean isEndOfLine(int c) {
                return c == '\n' || c == '\r' || c == -1;
            }
    
            public interface SpaceCharFilter {
                public boolean isSpaceChar(int ch);
            }
        }
        
    }
    class SegmentTree{
        int s[],n;
        SegmentTree(int l1){
            n=l1;
            int l=(int)Math.ceil(Math.log(n)/Math.log(2));
            l=2*(int)Math.pow(2,l)-1;
            s=new int[l];
            //createSegmentTreeUtil(a, 0, 0, a.length-1);
        }
        
        int createSegmentTreeUtil(int a[],int root,int l,int r){
            if(l==r)
            s[root]=a[l];
            else
            s[root]= Compare(createSegmentTreeUtil(a, 2*root+1, l, (l+r)/2), createSegmentTreeUtil(a,2*root+2, (l+r)/2+1,r));
            return s[root];
        }
        int getValue(int gl,int gr){
            return getValueUtil(0, 0, n-1, gl, gr);
        }
        int getValueUtil(int root,int l,int r,int gl,int gr){
            if(l>=gl&&r<=gr){
                return s[root];
            }
            if(l>gr||r<gl){
                return 0;
            }
            return Compare(getValueUtil(2*root+1, l, (l+r)/2, gl, gr), getValueUtil(2*root+2, (l+r)/2+1, r, gl, gr));
        }
        void update(int p,int k){
            updateUtil(p, k,0,0,n-1);
        }
        int updateUtil(int p,int k,int root,int l,int r){
            if(l==r&&l==k){
                return s[root]=p;
            }
            else if(l>k||r<k)
            return s[root];
            else{
                return s[root]=Compare(updateUtil(p, k, 2*root+1, l, (l+r)/2), updateUtil(p, k, 2*root+2,(l+r)/2+1,r ));
            }
        }
        int Compare(int a,int b){
            return Math.max(a, b);
        }
    }
    
    
        class Pair{
            int le;
            int p;
            Pair(int leaves,int parent){
                le=leaves;
                p=parent;
            }
        }
        
        
        