#include <bits/stdc++.h>
using namespace std;
int n, k;
int a[200010];
bool OK(int val) {
  int k2 = n;
  bool u = 1;
  for (int i = 1; i <= n; i++) {
    if (u && a[i] > val) {
      k2--;
      continue;
    } else
      u = !u;
  }
  if (k2 >= k) return 1;
  k2 = n, u = 1;
  for (int i = 1; i <= n; i++) {
    if (!u && a[i] > val) {
      k2--;
      continue;
    } else
      u = !u;
  }
  return k2 >= k;
  return 0;
}
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int st = 1, dr = 1e9;
  while (st <= dr) {
    int mid = (st + dr) / 2;
    if (OK(mid))
      dr = mid - 1;
    else
      st = mid + 1;
  }
  cout << dr + 1;
  return 0;
}
