#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e5 + 5;
int n, k, ar[MAX];
bool pred(int x, int src) {
  int res = 0;
  for (int i = 0; i < n; ++i) {
    if (!src) {
      ++res;
      src ^= 1;
    } else if (ar[i] <= x) {
      ++res;
      src ^= 1;
    }
  }
  return res >= k;
}
void solve() {
  cin >> n >> k;
  for (int i = 0; i < n; ++i) cin >> ar[i];
  int lo = 1, hi = 1e9;
  while (lo < hi) {
    int mid = lo + (hi - lo) / 2;
    if (pred(mid, 0) || pred(mid, 1))
      hi = mid;
    else
      lo = mid + 1;
  }
  cout << lo << endl;
}
int main() {
  int test = 1;
  while (test--) solve();
}
