#include <bits/stdc++.h>
using namespace std;
int64_t ar[(int64_t)2e5 + 10];
bool possible(int64_t val, int64_t n, int64_t k, int64_t cur) {
  int64_t ans = 0;
  for (int64_t i = 0; i < n; i++) {
    if (!cur) {
      ans++;
      cur ^= 1;
    } else {
      if (ar[i] <= val) {
        ans++;
        cur ^= 1;
      }
    }
  }
  return ans >= k;
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int64_t n, k;
  cin >> n >> k;
  for (int64_t i = 0; i < n; i++) cin >> ar[i];
  int64_t ans = (int64_t)1e9;
  int64_t st = 1;
  int64_t en = (int64_t)1e9;
  int64_t lodd = (k + 1) / 2;
  int64_t leven = k / 2;
  while (en > st) {
    int64_t mid = (st + en) / 2;
    if (possible(mid, n, k, 0) || possible(mid, n, k, 1)) {
      ans = min(ans, mid);
      en = mid;
    } else {
      st = mid + 1;
    }
  }
  cout << ans << "\n";
  return 0;
}
