#include <bits/stdc++.h>
using namespace std;
const int maxn = 200010;
int n, k, a[maxn];
int f(int x) {
  int cur = 0;
  for (int i = 1; i <= n; i++) {
    if (!(cur & 1)) {
      if (a[i] <= x) cur++;
    } else
      cur++;
  }
  int ans = cur;
  cur = 0;
  for (int i = 1; i <= n; i++) {
    if (cur & 1) {
      if (a[i] <= x) cur++;
    } else
      cur++;
  }
  ans = max(ans, cur);
  return ans;
}
int main(void) {
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  int l = 1, r = 1e9;
  while (r > l) {
    int mid = (l + r) >> 1;
    if (f(mid) >= k)
      r = mid;
    else
      l = mid + 1;
  }
  printf("%d\n", r);
  return 0;
}
