#include <bits/stdc++.h>
using namespace std;
const int NMAX = 2e5 + 5;
const int INF = 1e9;
int n, k, a[NMAX];
int check(int mid) {
  int cur = 1, curc = 0, cnt = 0, cntc = 0;
  for (int i = 1; i <= n; i++) {
    if (cur) {
      if (a[i] <= mid) cnt++, cur = 0;
    } else
      cnt++, cur = 1;
    if (curc) {
      if (a[i] <= mid) cntc++, curc = 0;
    } else
      cntc++, curc = 1;
  }
  return (cnt >= k || cntc >= k) ? mid : 0;
}
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  int l = 1, r = 1e9, mid, res = INF, hmm;
  while (l < r) {
    mid = (l + r) / 2;
    if (check(mid)) {
      r = mid, res = min(res, mid);
    } else
      l = mid + 1;
  }
  cout << res;
  return 0;
}
