#include <bits/stdc++.h>
using namespace std;
int scan_int() {
  int x;
  if (!scanf("%d", &x)) throw 1;
  return x;
}
bool f(const vector<bool>& a, int p, int N, int K) {
  for (int i = 0, j = 0; i < K; ++i) {
    while (i % 2 == p && j < N && !a[j]) ++j;
    if (j >= N) return false;
    ++j;
  }
  return true;
}
int main() {
  int N = scan_int();
  int K = scan_int();
  vector<int> A(N);
  for (auto& x : A) x = scan_int();
  auto B = A;
  sort(B.begin(), B.end());
  int L = -1, R = N - 1;
  while (R - L > 1) {
    int m = (L + R) / 2;
    vector<bool> a(N);
    for (int i = 0; i < N; ++i) a[i] = A[i] <= B[m];
    if (f(a, 0, N, K) || f(a, 1, N, K)) {
      R = m;
    } else {
      L = m;
    }
  }
  printf("%d\n", B[R]);
}
