#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
int n, k;
int a[N];
bool check(int x) {
  if (k % 2 == 0) {
    int cnt = 0;
    for (int i = 1; i < n; i++) {
      if (a[i] <= x) cnt++, i++;
    }
    if (cnt >= k / 2) return true;
    cnt = 0;
    for (int i = 0; i < n - 1; i++) {
      if (a[i] <= x) cnt++, i++;
    }
    if (cnt >= k / 2)
      return true;
    else
      return false;
  } else {
    int cnt = 0;
    for (int i = 1; i < n - 1; i++) {
      if (a[i] <= x) cnt++, i++;
    }
    if (cnt >= k / 2) return true;
    cnt = 0;
    for (int i = 0; i < n; i++) {
      if (a[i] <= x) cnt++, i++;
    }
    if (cnt >= k / 2 + 1) return true;
    return false;
  }
}
int main() {
  cin >> n >> k;
  int l = 1e9 + 1, r = -1;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    l = min(l, a[i]);
    r = max(r, a[i]);
  }
  while (l < r) {
    int mid = l + r >> 1;
    if (check(mid))
      r = mid;
    else
      l = mid + 1;
  }
  cout << l << endl;
  return 0;
}
