#include <bits/stdc++.h>
using namespace std;
const int N = 200004;
int a[N], n, k;
int sol(int l, int r, int v) {
  int ans = 0;
  for (int i = l; i <= r;) {
    if (a[i] <= v) {
      ++ans;
      i += 2;
    } else
      ++i;
  }
  return ans;
}
bool ok(int x) {
  int w = k / 2;
  if (k & 1)
    return sol(1, n, x) >= k - w || sol(2, n - 1, x) >= w;
  else
    return sol(1, n - 1, x) >= w || sol(2, n, x) >= w;
}
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  int l = 1, r = 1000000004;
  while (l < r) {
    int mid = (l + r) >> 1;
    if (ok(mid))
      r = mid;
    else
      l = mid + 1;
  }
  printf("%d\n", l);
}
