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>
using namespace std;
using ll = long long;
using ull = unsigned long long;
const int N = 2e5 + 5, M = 1e6 + 5, MOD = 1e9 + 7, CM = 998244353,
          INF = 0x3f3f3f3f;
const double eps = 1e-6;
ll pow(ll a, ll b, ll p) {
  ll ans = 1;
  a %= p;
  while (b) {
    if (b & 1) ans = ans * a % p;
    a = a * a % p;
    b >>= 1;
  }
  return ans;
}
ll inv1(ll a, ll p) { return pow(a, p - 2, p); }
void ex_gcd(ll a, ll b, ll &d, ll &x, ll &y) {
  if (!b) {
    d = a, x = 1, y = 0;
    return;
  }
  ex_gcd(b, a % b, d, y, x);
  y -= x * (a / b);
}
ll inv2(ll a, ll p) {
  ll d, x, y;
  ex_gcd(a, p, d, x, y);
  return d == 1 ? (x % p + p) % p : -1;
}
ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
int rand(int a, int b) { return rand() % (b - a + 1) + a; }
namespace IO {
template <typename T>
inline void w(T x) {
  if (x > 9) w(x / 10);
  putchar(x % 10 + 48);
}
template <typename T>
inline void write(T x, char c) {
  if (x < 0) putchar('-'), x = -x;
  w(x);
  putchar(c);
}
template <typename T>
inline void read(T &x) {
  x = 0;
  T f = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48);
  x *= f;
}
};  // namespace IO
struct ios {
  inline char read() {
    static const int IN_LEN = 1e6 + 10;
    static char buf[IN_LEN], *s, *t;
    return (s == t) && (t = (s = buf) + fread(buf, 1, IN_LEN, stdin)),
           s == t ? -1 : *s++;
  }
  template <typename _Tp>
  inline ios &operator>>(_Tp &x) {
    static char c11, boo;
    for (c11 = read(), boo = 0; !isdigit(c11); c11 = read())
      if (c11 == -1) return *this;
    boo |= c11 == '-';
    for (x = 0; isdigit(c11); c11 = read()) x = x * 10 + (c11 ^ '0');
    boo && (x = -x);
    return *this;
  }
} io;
int n, k;
int a[N];
bool check(int mid) {
  int tot = 0;
  bool f = 0;
  for (int i = 1; i <= n; i++) {
    if (f == 0) {
      if (a[i] <= mid) {
        tot++;
        f = 1;
      }
    } else {
      tot++;
      f = 0;
    }
  }
  if (tot >= k) return 1;
  tot = 1, f = 0;
  for (int i = 2; i <= n; i++) {
    if (f == 0) {
      if (a[i] <= mid) {
        tot++;
        f = 1;
      }
    } else {
      tot++;
      f = 0;
    }
  }
  if (tot >= k) return 1;
  return 0;
}
void solve(int kase) {
  scanf("%d", &n), scanf("%d", &k);
  int mx = 0;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), mx = max(a[i], mx);
  int l = 1, r = mx;
  for (int i = 1; i <= 100; i++) {
    int mid = (l + r) >> 1;
    if (check(mid))
      r = mid;
    else
      l = mid + 1;
  }
  printf("%d\n", l);
}
const bool DUO = 0;
void TIME() {
  clock_t start, finish;
  double totaltime;
  start = clock();
  if (DUO) {
    int Kase = 0;
    cin >> Kase;
    for (int kase = 1; kase <= Kase; kase++) solve(kase);
  } else
    solve(1);
  finish = clock();
  totaltime = (double)(finish - start) / CLOCKS_PER_SEC;
  printf("\nTime:%lfms\n", totaltime * 1000);
}
int main() {
  if (DUO) {
    int Kase = 0;
    cin >> Kase;
    for (int kase = 1; kase <= Kase; kase++) solve(kase);
  } else
    solve(1);
  return 0;
}
