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.
#attempted after the contest
# we knoe that ans can be at best sorted[k//2 - 1] and at least as good as sorted[k-1]
# therefore look at all these vals
#find the index ind s.t picking gapped els less than sorted[ind-1] is possible but sorted[ind] is 


def is_possible(val, arr, k):
	#is it possible to pick gapped els less than sorted
	# index = 0
	# while(True):
	count = 0
	just_added = False
	for el in arr:
		if el > val:
			just_added = False
		else:
			#can i added
			if not just_added:
				just_added = True
				count += 1
				if count == k:
					return True 
			else:
				just_added = False
	return False

def binary_search(possible_sorted_answers, arr, to_pick):
	# b = arr.copy()
	# b.sort()
	# if k%2 == 1:
	# left = k//2 - 1
	# right = k - 1
	left = 0
	right = len(possible_sorted_answers)
	while(True):
		x = (left + right)//2
		# print("left right are {} {}".format(left, right))
		# print("x is {}".format(x))
		p1 = is_possible(possible_sorted_answers[x], arr, to_pick)
		if p1 and x == 0:
			return possible_sorted_answers[0]
		elif p1:
			right = x
		else:
			if x == len(possible_sorted_answers) - 1:
				return possible_sorted_answers[-1]
			else:
				p2 = is_possible(possible_sorted_answers[x+1], arr, to_pick)
				if p2:
					return possible_sorted_answers[x+1]
				else:
					left = x

			# p2 = is_possible(possible)
			# left = x

	# while(True):
	# 	x = (left + right)//2
	# 	p1 = is_possible(possible_sorted_answers[x], arr, to_pick)
		
	# 	if p1 and x == 0:

	# 	if x == len(possible_sorted_answers) - 1:
	# 		p2 = True
	# 	else:
	# 		p2 =is_possible(possible_sorted_answers[x+1], arr, to_pick)

	# 	if ((not p1) and p2):
	# 		return possible_sorted_answers[x+1]
	# 	elif p1 and p2:
	# 		right = x
	# 	elif (not p1) and (not p2):
	# 		left = x
	# 	else:
	# 		print('ERROR')

	# while(True):
	# 	x = (left + right)//2
	# 	p1 = is_possible(b[x], arr, k)


import sys

def input():
	return sys.stdin.readline().rstrip()

def input_split():
	return [int(i) for i in input().split()]

n, k = input_split()
arr = input_split()

arr_sorted = arr.copy()
arr_sorted.sort()
possible_sorted_answers = arr_sorted[(k//2)-1 : k]
if k%2 == 0:
	ans = min(binary_search(possible_sorted_answers, arr[:-1], k//2),
			  binary_search(possible_sorted_answers, arr[1:], k//2))
else:
	ans = min(binary_search(possible_sorted_answers, arr[1:-1], k//2),
			  binary_search(possible_sorted_answers, arr, (k//2) + 1))

print(ans)