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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;

public class _651 {

	static Reader r = new Reader();
	static PrintWriter out = new PrintWriter(System.out);

	private static void solve1() throws IOException {

		int t = r.nextInt();
		StringBuilder res = new StringBuilder();

		while (t-- > 0) {

			int n = r.nextInt();

			int ans = 1;
			for (int i = n; i >= 1; i--) {
				if (i * 2 <= n) {
					ans = i;
					break;
				}
			}

			res.append(ans).append("\n");
		}

		out.print(res);
		out.close();
	}

	private static void solve2() throws IOException {

		int t = r.nextInt();
		StringBuilder res = new StringBuilder();

		while (t-- > 0) {

			int n = r.nextInt();
			int arr[] = r.nextIntArray(2 * n);

			ArrayList<Integer> odd = new ArrayList<Integer>();
			ArrayList<Integer> even = new ArrayList<Integer>();

			for (int i = 0; i < 2 * n; i++) {
				if ((arr[i] & 1) == 0) {
					even.add(i + 1);
				} else {
					odd.add(i + 1);
				}
			}

			int odd_si = odd.size() % 2;
			int even_si = even.size() % 2;

			int cnt = 0;
			for (int i = odd_si; i < odd.size() && cnt < n - 1; i += 2) {
				cnt++;
				out.println(odd.get(i) + " " + odd.get(i + 1));
			}
			for (int i = even_si; i < even.size() && cnt < n - 1; i += 2) {
				cnt++;
				out.println(even.get(i) + " " + even.get(i + 1));
			}

		}
		out.close();

	}

	private static void solve3() throws IOException {

		int t = r.nextInt();
		StringBuilder res = new StringBuilder();

		while (t-- > 0) {

			int n = r.nextInt();

			int chance = 0;

			while (n > 1) {

				int odd_div = -1;

				if ((n & 1) != 0) {
					odd_div = n;
				} else {
					int temp = n;
					boolean flag = true;
					for (int i = 3; i <= temp && flag; i += 2) {
						if (temp % i == 0 && flag) {
							while (temp % i == 0 && flag) {
								odd_div = Math.abs(odd_div);
								odd_div *= i;
								temp /= i;
								if ((temp & 1) == 0) {
									flag = false;
								}
							}
						}
					}
				}

				if (odd_div == -1) {
					n--;
				} else {
					n /= odd_div;
				}

				chance = (chance + 1) % 2;

			}

			res.append(chance == 0 ? "FastestFinger" : "Ashishgup").append("\n");

		}

		out.print(res);
		out.close();

	}

	static int arr[], k;

	private static boolean isPoss(int maxVal, int flag) {
		int cnt = 0;
		for (int ele : arr) {
			if (ele <= maxVal || (cnt & 1) != flag) {
				cnt++;
			}
		}
		return (cnt >= k) ? true : false;
	}

	private static int binarySearch(int lt, int rt) {
		int ans = Integer.MAX_VALUE;
		while (lt <= rt) {
			int mid = (lt + rt) / 2;
			if (isPoss(mid, 0) || isPoss(mid, 1)) {
				ans = Math.min(ans, mid);
				rt = mid - 1;
			} else {
				lt = mid + 1;
			}
		}
		return ans;
	}

	private static void solve4() throws IOException {

		int n = r.nextInt();
		k = r.nextInt();

		arr = new int[n];

		int max = Integer.MIN_VALUE;
		for (int i = 0; i < n; i++) {
			arr[i] = r.nextInt();
			max = Math.max(max, arr[i]);
		}

		int ans = binarySearch(1, max);

		out.print(ans);
		out.close();

	}

	private static void solve5() throws IOException {

		int t = r.nextInt();
		StringBuilder res = new StringBuilder();

		while (t-- > 0) {

			int n = r.nextInt();

			res.append(false).append("\n");
		}

		out.print(res);
		out.close();
	}

	private static void solve6() throws IOException {

		int t = r.nextInt();
		StringBuilder res = new StringBuilder();

		while (t-- > 0) {

			int n = r.nextInt();

			res.append(false).append("\n");
		}

		out.print(res);
		out.close();
	}

	public static void main(String[] args) throws IOException {

//		solve1();

//		solve2();

//		solve3();

		solve4();

		// solve5();

		// solve6();

	}

	static class Reader {

		final private int BUFFER_SIZE = 1 << 12;
		boolean consume = false;
		private byte[] buffer;
		private int bufferPointer, bytesRead;
		private boolean reachedEnd = false;

		public Reader() {
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = 0;
			bytesRead = 0;
		}

		public boolean hasNext() {
			return !reachedEnd;
		}

		private void fillBuffer() throws IOException {
			bytesRead = System.in.read(buffer, bufferPointer = 0, BUFFER_SIZE);
			if (bytesRead == -1) {
				buffer[0] = -1;
				reachedEnd = true;
			}
		}

		private void consumeSpaces() throws IOException {
			while (read() <= ' ' && reachedEnd == false)
				;
			bufferPointer--;
		}

		private byte read() throws IOException {
			if (bufferPointer == bytesRead) {
				fillBuffer();
			}
			return buffer[bufferPointer++];
		}

		public String next() throws IOException {
			StringBuilder sb = new StringBuilder();
			consumeSpaces();
			byte c = read();
			do {
				sb.append((char) c);
			} while ((c = read()) > ' ');
			if (consume) {
				consumeSpaces();
			}
			;
			if (sb.length() == 0) {
				return null;
			}
			return sb.toString();
		}

		public String nextLine() throws IOException {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			String str = br.readLine();
			return str;
		}

		public int nextInt() throws IOException {
			consumeSpaces();
			int ret = 0;
			byte c = read();
			boolean neg = (c == '-');
			if (neg) {
				c = read();
			}
			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');
			if (consume) {
				consumeSpaces();
			}
			if (neg) {
				return -ret;
			}
			return ret;
		}

		public long nextLong() throws IOException {
			consumeSpaces();
			long ret = 0;
			byte c = read();
			boolean neg = (c == '-');
			if (neg) {
				c = read();
			}
			do {
				ret = ret * 10L + c - '0';
			} while ((c = read()) >= '0' && c <= '9');
			if (consume) {
				consumeSpaces();
			}
			if (neg) {
				return -ret;
			}
			return ret;
		}

		public double nextDouble() throws IOException {
			consumeSpaces();
			double ret = 0;
			double div = 1;
			byte c = read();
			boolean neg = (c == '-');
			if (neg) {
				c = read();
			}
			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');
			if (c == '.') {
				while ((c = read()) >= '0' && c <= '9') {
					ret += (c - '0') / (div *= 10);
				}
			}
			if (consume) {
				consumeSpaces();
			}
			if (neg) {
				return -ret;
			}
			return ret;
		}

		public int[] nextIntArray(int n) throws IOException {
			int[] a = new int[n];
			for (int i = 0; i < n; i++) {
				a[i] = nextInt();
			}
			return a;
		}

		public long[] nextLongArray(int n) throws IOException {
			long[] a = new long[n];
			for (int i = 0; i < n; i++) {
				a[i] = nextLong();
			}
			return a;
		}

		public int[][] nextIntMatrix(int n, int m) throws IOException {
			int[][] grid = new int[n][m];
			for (int i = 0; i < n; i++) {
				grid[i] = nextIntArray(m);
			}
			return grid;
		}

		public char[][] nextCharacterMatrix(int n) throws IOException {
			char[][] a = new char[n][];
			for (int i = 0; i < n; i++) {
				a[i] = next().toCharArray();
			}
			return a;
		}

		public void close() throws IOException {
			if (System.in == null) {
				return;
			} else {
				System.in.close();
			}
		}
	}

}