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.

//..............Learning.........//



import java.util.*;
import java.io.*;
import java.lang.*;
import java.math.BigInteger;

public class A {

static FastReader		sc	= new FastReader();
static PrintWriter	out	= new PrintWriter(System.out);

public static void main(String[] args) throws Exception {
//	try {
//
	int t = 1;
	while (t-- > 0)
		A.go();
	out.flush();
//	} catch (Exception e) {
//		return;
//	}
}


static HashSet<Integer>	set		= new HashSet<Integer>();

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Code Starts <<<<<<<<<<<<<<<<<<<<<<<<<<<<< //

static void go() {
int n=sc.nextInt();
int k=sc.nextInt();
int a[]=new int[n];
for(int i=0;i<n;i++) {
	a[i]=sc.nextInt();
}
int l=1;int r=(int)1e9;
while(l<=r) {
	int mid=l+(r-l)/2;
	int count=0;
	for(int i=0;i<n;i++) {
		if(a[i]<=mid) {
			count+=1;
		}
}
	if(count==k) {
		out.println(mid);
		return;
	}
	if(count<k) {
		l=mid+1;
	}else {
		r=mid-1;
	}
}
out.println(-1);
}


//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Code Ends <<<<<<<<<<<<<<<<<<<<<<<<<<<<< //

static long gcd(long a, long b) {
	if (b==0) {
		return a;
	}return gcd(b, a%b);
}
static int	prime[]	= new int[200005];
static int	N				= 200005;
static void sieve() {

	for(int i=0;i<N;i++) {
		prime[i]=i;
}
	for (int i = 2; i * i <= N; i++) {
		if (prime[i] == i) {
			prime[i]=i;
			for (int j = i; j < N; j += i) {
				prime[j] =i;
			}}}
}


static int gcd(int a, int b) {
	if (b == 0) {
		return a;
	}return gcd(b, a % b);
}
 static void sort(int[] a) {
	ArrayList<Integer> aa = new ArrayList<>();
	for (Integer i : a) {
		aa.add(i);	}
	Collections.sort(aa);
	for (int i = 0; i < a.length; i++)
		a[i] = aa.get(i);}
static void sort(long[] a) {
	ArrayList<Long> aa = new ArrayList<>();
	for (Long i : a) {
		aa.add(i);}
	Collections.sort(aa);
	for (int i = 0; i < a.length; i++)
		a[i] = aa.get(i);
}

static int mod = (int) 1e9 + 7;

static long pow(long x, long y) {
	long res = 1l;
	while (y != 0) {
		if (y % 2 == 1) {
			res = (x * res);
			}	y /= 2;x = (x * x);
	}
	return res;
}


//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Fast IO <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< //

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;
	}	}}

class time{
int a;int d;
time(int a,int d ){
	this.a=a;this.d=d;
}

}