#include <bits/stdc++.h>
using namespace std;
const int maxn = 200009;
const int MOD = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false), cout.tie(0), cin.tie(0);
  int n, k;
  cin >> n >> k;
  vector<int> A(n);
  for (int i = 0; i < n; ++i) cin >> A[i];
  auto ok = [&](int v) -> bool {
    int cnt = 0, nxt = 1;
    for (int i = 0; i < n; ++i) {
      if (nxt == 0)
        cnt++, nxt = 1;
      else if (A[i] <= v)
        cnt++, nxt = 0;
    }
    if (cnt >= k) return true;
    cnt = 0, nxt = 0;
    for (int i = 0; i < n; ++i) {
      if (nxt == 0)
        cnt++, nxt = 1;
      else if (A[i] <= v)
        cnt++, nxt = 0;
    }
    if (cnt >= k) return true;
    return false;
  };
  int l = 1, r = 1e9;
  while (l < r) {
    int mid = l + r >> 1;
    if (ok(mid)) {
      r = mid;
    } else {
      l = mid + 1;
    }
  }
  cout << l << '\n';
  return 0;
}
