#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int a[maxn], b[maxn], n, k;
bool isok(int zhi) {
  int ji = 0, ou = 0;
  for (int i = 1; i <= n; i++)
    if (a[i] <= zhi) {
      ji++, i++;
      if (i <= n) ou++;
    }
  if (ji >= (k + 1) / 2 && ou >= k / 2) return true;
  ji = 1, ou = 0;
  for (int i = 2; i <= n; i++)
    if (a[i] <= zhi) {
      ou++, i++;
      if (i <= n) ji++;
    }
  if (ji >= (k + 1) / 2 && ou >= k / 2) return true;
  return false;
}
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  sort(b + 1, b + 1 + n);
  int l = 1, r = n, mid, ans = 1e9;
  while (r >= l) {
    mid = l + r >> 1;
    if (isok(b[mid]))
      r = mid - 1, ans = b[mid];
    else
      l = mid + 1;
  }
  cout << ans;
}
