#include <bits/stdc++.h>
using namespace std;
int n, k, a[200000 + 20];
bool Judge(int x, int opt) {
  int num = 0;
  for (register int i = 1; i <= n; i++) {
    if (!opt)
      num++, opt ^= 1;
    else if (a[i] <= x)
      num++, opt ^= 1;
  }
  return num >= k;
}
int main(void) {
  cin >> n >> k;
  for (register int i = 1; i <= n; i++) cin >> a[i];
  int l = 0, r = 1e9;
  while (l < r) {
    int mid = l + r >> 1;
    if (Judge(mid, 0) || Judge(mid, 1))
      r = mid;
    else
      l = mid + 1;
  }
  cout << l << endl;
}
