#include <bits/stdc++.h>
using namespace std;
void debug_out() { cerr << '\n'; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << H;
  debug_out(T...);
}
const int DMAX = 2e5 + 10;
vector<int> vec;
vector<int> arb[DMAX];
int V[DMAX];
bool uz[DMAX];
int n, k;
bool check(int val);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int t, i, j;
  long long int st, dr, mij;
  cin >> n >> k;
  for (i = 1; i <= n; i++) cin >> V[i];
  st = 0;
  dr = 1e9 + 1;
  while (dr - st > 1) {
    mij = (st + dr) / 2;
    if (check(mij))
      dr = mij;
    else
      st = mij;
  }
  cout << dr << '\n';
  return 0;
}
bool check(int val) {
  int imp = 0, par = 0;
  int i;
  for (i = 1; i <= n; i++)
    if (V[i] <= val) {
      imp++;
      if (i != n) par++;
      i++;
    }
  if (par + imp >= k) return 1;
  par = 0;
  imp = 1;
  for (i = 2; i <= n; i++)
    if (V[i] <= val) {
      par++;
      if (i != n) imp++;
      i++;
    }
  if (par + imp >= k) return 1;
  return 0;
}
