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.
#include <bits/stdc++.h>
int findmax(int *a, int s, int n);
void mergsort(long long int a[], long long int t[], int size, int n);
void merg(long long int a[], long long int t[], int l1, int u1, int l2, int u2);
void copy(long long int a[], long long int t[], int n);
long long int min(long long int a, long long int b) {
  if (a < b)
    return (a);
  else
    return (b);
}
long long int max(long long int a, long long int b) {
  if (a > b)
    return (a);
  else
    return (b);
}
long long int mod(long long int a) {
  if (a < 0)
    return (-a);
  else
    return (a);
}
long long int p = 1000000007;
long long int fre(long long int a, long long int m) {
  if (a < m) return (0);
  if (a == m) return (1);
  long long int j, mul = 1;
  for (j = (a - m + 1); j <= a; j++) {
    mul = ((mul * j) % p);
  }
  a = mul;
  long long int power = p - 2;
  mul = 1;
  for (j = 1; j <= m; j++) {
    mul = ((mul * j) % p);
  }
  m = mul;
  while (power > 0) {
    if (power % 2 == 0) {
      power /= 2;
      m = ((m * m) % p);
      continue;
    } else {
      power--;
      a = ((a * m) % p);
    }
  }
  if (a < 0) a = a + p;
  return (a);
}
int gcd(int a, int b) {
  if (b % a == 0) {
    return (a);
  } else
    gcd(b % a, a);
}
int solve(long long int tar, long long int *x, int k, int n) {
  int j = 0, count = 0;
  for (j = 0; j < n; j++) {
    if (count % 2 == 0) {
      if (x[j] <= tar) count++;
    } else {
      count++;
    }
  }
  if (count >= k) return (1);
  count = 0;
  for (j = 0; j < n; j++) {
    if (count % 2 == 1) {
      if (x[j] <= tar) count++;
    } else {
      count++;
    }
  }
  if (count >= k)
    return (1);
  else
    return (0);
}
long long int binary_search(long long int l, long long int r, long long int *x,
                            int k, int n) {
  long long int mid, ans = -1;
  while (l <= r) {
    mid = (l + r) / 2;
    if (solve(mid, x, k, n)) {
      r = mid - 1;
      ans = mid;
    } else {
      l = mid + 1;
    }
  }
  return (ans);
}
long long int my_pow(long long int a, long long int power) {
  long long int mul = 1;
  while (power != 0) {
    if (power % 2 == 0) {
      power /= 2;
      a = (a * a) % p;
    } else {
      power--;
      mul = (mul * a) % p;
    }
  }
  return (mul);
}
int sieve[1000001];
void sieve_of_eratosthenes() {
  int j;
  for (j = 0; j <= 1000000; j++) sieve[j] = 0;
  j = 2;
  for (j = 2; j * j <= 1000000; j++) {
    if (sieve[j] == 0) {
      int k;
      for (k = j * j; k <= 1000000; k += j) {
        sieve[k] = 1;
      }
    }
  }
}
long long int po[1000001];
void f() {
  po[0] = 1;
  int j;
  for (j = 1; j <= 1000000; j++) {
    po[j] = 1;
    po[j] = (po[j - 1] * 2) % p;
  }
}
long long int fac[2000001];
void fact() {
  long long int j;
  fac[0] = 1;
  for (j = 1; j <= 2000000; j++) {
    fac[j] = 1;
    fac[j] = (fac[j - 1] * j) % p;
  }
}
long long int bet[2000001];
void calcofbet() {
  long long int j;
  for (j = 0; j <= 2000000; j++) {
    bet[j] = my_pow(fac[j], p - 2);
  }
}
long long int biggestprimedivisor[1000001];
long long int myceil(long long int a, long long int b) {
  if (a % b == 0)
    return (a / b);
  else
    return ((a / b) + 1);
}
long long int myfloor(long long int a, long long int b) {
  if (a % b == 0) return (a / b);
  return (a / b);
}
int check(int *a, int n) {
  int j, u = 0;
  for (j = 0; j < n - 1; j++) {
    if (a[j] <= a[j + 1]) {
      u++;
    } else
      break;
  }
  if (u == n - 1)
    return (1);
  else
    return (0);
}
int main() {
  int q;
  q = 1;
  while (q--) {
    int n, k, j;
    scanf("%d %d", &n, &k);
    long long int a[n];
    for (j = 0; j < n; j++) scanf("%lld", (a + j));
    { printf("%lld\n", binary_search(1, 1000000001, a, k, n)); }
  }
  return 0;
}
void mergsort(long long int a[], long long int t[], int size, int n) {
  int l1 = 0, l2, u1, u2;
  u1 = l1 + size - 1;
  l2 = u1 + 1;
  u2 = l2 + size - 1;
  if (u2 >= n - 1) u2 = n - 1;
  while (u1 < n - 1) {
    if (u2 >= n - 1) u2 = n - 1;
    merg(a, t, l1, u1, l2, u2);
    l1 = u2 + 1;
    u1 = l1 + size - 1;
    l2 = u1 + 1;
    u2 = l2 + size - 1;
  }
  copy(a, t, n);
}
void merg(long long int a[], long long int t[], int l1, int u1, int l2,
          int u2) {
  int i = l1, j = l2, k = l1;
  while ((i <= u1) && (j <= u2)) {
    if (a[i] <= a[j]) {
      t[k] = a[i];
      i++;
      k++;
      continue;
    } else if (a[j] < a[i]) {
      t[k] = a[j];
      k++;
      j++;
    }
  }
  while (i <= u1) {
    t[k] = a[i];
    k++;
    i++;
  }
  while (j <= u2) {
    t[k] = a[j];
    k++;
    j++;
  }
}
void copy(long long int a[], long long int t[], int n) {
  int j;
  for (j = 0; j < n; j++) {
    a[j] = t[j];
  }
}
