You are given a sequence of integers of length n and integer number k. You should print any integer number x in the range of [1; 10^9] (i.e. 1 ≤ x ≤ 10^9) such that exactly k elements of given sequence are less than or equal to x.

Note that the sequence can contain equal elements.

If there is no such x, print "-1" (without quotes).

Input

The first line of the input contains integer numbers n and k (1 ≤ n ≤ 2 ⋅ 10^5, 0 ≤ k ≤ n). The second line of the input contains n integer numbers a_1, a_2, ..., a_n (1 ≤ a_i ≤ 10^9) — the sequence itself.

Output

Print any integer number x from range [1; 10^9] such that exactly k elements of given sequence is less or equal to x.

If there is no such x, print "-1" (without quotes).

Examples

Input

7 4
3 7 5 1 10 3 20


Output

6

Input

7 2
3 7 5 1 10 3 20


Output

-1

Note

In the first example 5 is also a valid answer because the elements with indices [1, 3, 4, 6] is less than or equal to 5 and obviously less than or equal to 6.

In the second example you cannot choose any number that only 2 elements of the given sequence will be less than or equal to this number because 3 elements of the given sequence will be also less than or equal to this number.
//package practice1;

import java.io.*;
import java.lang.*;
import java.math.BigInteger;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;

public class Practice {
	
	
	
///////////////
	
	public static long gcd(long n1, long n2)
    {
        if (n2 != 0)
            return gcd(n2, n1 % n2);
        else
            return n1;
    }
	
////////////////	
	
	
	static class pair {
        Integer x,y;
        pair (int x,int y){
            this.x=x;
            this.y=y;
        }
    }
	
///////////////	
	
	static class length implements Comparator<String>
	{
		public int compare(String a,String b)
		{
			return(a.length()-b.length());
		}
	}
	
//////////////	
	
	
	
	   static class FastReader
	   {
		   BufferedReader br;
		   StringTokenizer st;
		   public FastReader()
		   {
			   br = new BufferedReader(new InputStreamReader(System.in));
		   }
		   
		   
		   String next() 
	        { 
	            while (st == null || !st.hasMoreElements()) 
	            { 
	                try
	                { 
	                    st = new StringTokenizer(br.readLine()); 
	                } 
	                catch (IOException  e) 
	                { 
	                    e.printStackTrace(); 
	                } 
	            } 
	            return st.nextToken(); 
	        } 
		   
		   
		   int nextInt()
		   {
			   return Integer.parseInt(next());
		   }
		   long nextLong()
		   {
			   return Long.parseLong(next());
		   }
		   double nextDouble() 
	        { 
	            return Double.parseDouble(next()); 
	        } 
		   
		   String nextLine() 
	        { 
	            String str = ""; 
	            try
	            { 
	                str = br.readLine(); 
	            } 
	            catch (IOException e) 
	            { 
	                e.printStackTrace(); 
	            } 
	            return str; 
	        } 
	   }
	   
	   
////////////////
	   
	   
	   
///////////////   
	   
	   
	  public static long Divisors(long n) 
	   { 
	       // Note that this loop runs till square root 
		   long sum=0;
	       for (int i=1; i*i<=(n); i++) 
	       { 
	           if (n%i == 0) 
	           { 
	               // If divisors are equal, print only one 
	               if (n/i == i) 
	               {
	                  // printf("%d ", i); 
	            	   sum=sum+1;
	               }
	     
	               else // Otherwise print both 
	               {
	                   //printf("%d %d ", i, n/i); 
	            	   sum=sum+2;
	               }
	           } 
	           if(sum>3)
	           {
	        	   break;
	           }
	       } 
	       return(sum);
	   } 
	   
	  
	  
////////////////////	  
	  
	  public static long SmallestPrimeDivisor(long n) 
	  { 
	      // if divisible by 2 
	      if (n % 2 == 0) 
	          return 2; 
	    
	      // iterate from 3 to sqrt(n) 
	      for (long i = 3; i * i <= n; i += 2) { 
	          if (n % i == 0) 
	              return i; 
	      } 
	    
	      return n; 
	  } 
	    
//////////////////	  
	   
	   public static boolean isprime(long n)
	    {
	        int count=0;
	     
	        for(long i=2;i*i<=n;i++)
	        {
	            if(n%i==0)
	            {
	                return(false);
	            }
	        }
	        return(true);
	    }
	
	   
/////////////////
	 
	//No.of SubArray which have exactly k different elements //   
	   public static int subArray(int a[],int k)
	   {
		   int count=0;
		   int left=0;
		   int right=0;
		   int n=a.length;
		   HashMap<Integer,Integer> h=new HashMap();
		   while(right<n)
		   {
			   h.put(a[right],(int)h.getOrDefault(a[right],0)+1);
			   while(h.size()>k)
			   {
				   h.put(a[left],h.get(a[left])-1);
				   
				   if(h.get(a[left])==0)
				   {
					   h.remove(a[left]);
				   }
				   
				   left++;
			   }
			   count+=right-left+1;
			   right++;
			 
			   

		   }
		   
		   
		   return count;
		   
	   }
	   
	   
/////////////////
	   
	   //find SubArray which has sum =k //
	   public static int[] sumk(int a[],int sum)
	   {
		   int b[]=new int[2];
		   b[0]=-1;
		   b[1]=-1;
		   int n=a.length;
		   HashMap<Integer,Integer> h=new HashMap();
		   int c_sum=0;
		  for(int i=0;i<n;i++)
		  {
			  c_sum+=a[i];
			  if(c_sum==sum)
			  {
				  b[0]=0;
				  b[1]=i;
				  break;
				 // System.out.println(b[0]+" "+b[1]);
			  }
			  
			  if(h.containsKey(c_sum-sum))
			  {
				  b[0]=h.get(c_sum-sum)+1;
				  b[1]=i;
				  break;
				 // System.out.println(b[0]+" "+b[1]);

			  }
			  
			  h.put(c_sum,i);
		  }
		  return(b);
	   }
	   
	   
	   
////////////
	   
	   
//No.of SubArray which have given element exatly k times //   
public static int ExactlyKTimes(char a[],char c,int k)
{
int count=0;
int left=0;
int right=0;
int n=a.length;
HashMap<Character,Integer> h=new HashMap();
while(right<n)
{
h.put(a[right],(int)h.getOrDefault(a[right],0)+1);
while(h.get(c)>k && left<=right)
{
h.put(a[left],h.get(a[left])-1);

if(h.get(a[left])==0)
{
h.remove(a[left]);
}

left++;
}
count+=right-left+1;
right++;



}


return count;

}


/////////////////////
                /////No.of subArray or SubString in which Each elements occour at most K times//////

     public static int AtMostK(char c[],int k)
     {
    	 int left=0,right=0,count=0;
    	 HashMap<Character,Integer> h=new HashMap();
    	 int n=c.length;
    	 while(right<n)
    	 {
    		 h.put(c[right],h.getOrDefault(c[right],0)+1);
    		 while(h.get(c[right])>k)
    		 {
    			 h.put(c[left],h.get(c[left])-1);
    			 if(h.get(c[left])==0)
    			 {
    				 h.remove(c[left]);
    			 }
    			 left++;
    		 }
    		 count+=right-left+1;
    		 right++;
    	 }
    	 return count;
    	 
     }
     


////////////////////
     //Longest Substring which has k unique characters//
     public static int longestK(char c[],int k)
     {
    	 int max=-1;
    	 int left=0,right=0;
    	 int n=c.length;
    	 HashMap<Character,Integer> h=new HashMap();
    	 int m=0;
    	 while(right<n)
    	 {
    		 h.put(c[right],h.getOrDefault(c[right],0)+1);
    		 m++;
    		 while(h.size()>k)
    		 {
    			 h.put(c[left],h.get(c[left])-1);
    			 m--;
    			 if(h.get(c[left])==0)
    			 {
    				 h.remove(c[left]);
    				 
    			 }
    			 left++;
    		 }
    		 if(h.size()==k)
    		 {
    			 if(m>max)
    			 {
    				 max=m;
    			 }
    		 }
    		 right++;
    	 }
    	 
    	 return max;
     }
     
     
     
     
     
////////////////////
  
////////////////////
	   
	   
	   
	   
	   
	   
	   
	   
	   
	   
	   
	   
	   
	   
	   
	   
	   
	   
	   
	   
	   

		public static void main(String []args) throws Exception
		{
			
			/*
			 FastReader in =new FastReader();
				//Scanner in=new Scanner(System.in);
			PrintWriter pw = new PrintWriter(System.out);
			//double x=2.0;
			BigInteger p = BigInteger.ONE;
			pw.print(p);
			pw.flush();
			pw.close();
			*/
			//Scanner in=new Scanner(System.in);
			 FastReader in =new FastReader();	
			 PrintWriter pw = new PrintWriter(System.out);
			//int x=in.nextInt();
			 /*
			LinkedList<Integer> p=new LinkedList();
			 p.add(3);
			 p.add(2);
			 p.add(4);
			 p.add(2);
			 Collections.sort(p);
			 pw.print(p.poll());
			 pw.print(p.poll());

			 pw.print(p.poll());

			 pw.print(p.poll());
			 /*
			 PriorityQueue<Integer> p=new PriorityQueue<Integer>();
			 p.add(3);
			 p.add(2);
			 p.add(4);
			 p.add(2);
			Object a[]= p.toArray();
			pw.println(a[2]);
			 pw.print(p.poll());
			 pw.print(p.poll());

			 pw.print(p.poll());

			 pw.print(p.poll());
            */
			 
			 
			 
			 
			 
			int n=in.nextInt();
			int k=in.nextInt();
			//int a[]=new int[n];
			int min=999999999,max=0;
			LinkedList<Integer> a=new LinkedList();
			for(int i=0;i<n;i++)
			{
				int y=in.nextInt();
				a.add(y);
				if(y<min)
				{
					min=y;
				}
				if(y>max)
				{
					max=y;
				}
			}
			if(k==n)
			{
				pw.println(max);
			}
			else
			{
				if(k==0)
				{
					if(min==1)
					{
						pw.println(-1);
					}
					else
					{
						pw.println(1);
					}
				}
				else
				{
					Collections.sort(a);
					int y1=a.get(k-1);
					int y2=a.get(k);
					if(y1==y2)
					{
						pw.println(-1);
					}
					else
					{
						pw.println(y1);
					}
				}
			}
         
			
	        pw.flush();
			pw.close();
			
			
			
			
	}
		
		
}		
		
		
		
		
		
		
		
	

