#include <bits/stdc++.h>
using namespace std;
const int oo = (int)1e9;
const int mod = 1e9 + 7;
void IOS() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
void FRE() {
  freopen(
      "1370_D"
      ".inp",
      "r", stdin);
  freopen(
      "1370_D"
      ".out",
      "w", stdout);
}
const int N = 2 * (1e5) + 10;
int n, k, Ans = oo;
int A[N];
vector<int> odd;
vector<int> even;
bool check(int m, bool tt) {
  int sz = 0;
  for (int i = (1); i <= (n); i++) {
    if (!tt) {
      if (A[i] <= m) {
        sz++;
        tt ^= 1;
      }
    } else {
      sz++;
      tt ^= 1;
    }
  }
  return (sz >= k);
}
int BS() {
  int l = 0, r = oo;
  while (r - l > 1) {
    int m = (l + r) >> 1;
    if (check(m, 0) || check(m, 1)) {
      r = m;
    } else {
      l = m;
    }
  }
  return r;
}
int main() {
  IOS();
  cin >> n >> k;
  for (int i = (1); i <= (n); i++) cin >> A[i];
  int Ans = BS();
  cout << Ans;
  return 0;
}
